I need to detect OS name & version in Java. That I can do by
String os_name = System.getProperty("os.name", "");
String os_version = System.getProperty("os.version", "");
but the problem is that this is not reliable. Sometimes it returns incorrect information, and I can't detect all operating systems, except the most popular Windows, MacOS, Linux etc, and this even provides wrong information in the case of 64 bit operating systems. I need to detect any OS with any kind of specification. I am unable to find the right solution for this.
Maybe I can do this with JavaScript? If it's impossible in Java then please tell me how to do it with JavaScript.
Any input or suggestions highly appreciated.
Thanks in advance.
Best regards,
**Nilanjan Chakraborty