Recently I moved on a brand new machine 64-bit Windows 7. But when I run this code, getting the incorrect OS name
String osName = System.getProperty("os.name");
System.out.println("OS Name = " + osName);
The output comes:
OS Name = Windows Vista
Any idea, what is wrong in my code or system?
Thanks in Advance.
You might be using an older version of Java. As this was a known bug(bug_id=6819886) that has been fixed in the newer versions.
Kindly read this for further details.
A possible workaround for this in case you are not able to upgrade your java version: