I have stumbled across something truly puzzling regarding System.getProperty("os.name")
. According to a Java bug on the matter and the Java 5 release notes (search for "os.name"), there was a bug in Java with early "longhorn" versions of Vista that should have been fixed in v5 release 10.
However on my Vista SP1 box - using both v5 release 15 and v6 release 6 - System.getProperty("os.name")
returns "Windows XP". Further System.getProperty("os.version")
returns "5.1". I cannot find anything relating to this issue via Google though. This makes me wonder whether it is something odd with my Vista setup. I have tried calling the GetVersionEx() API function from a test C program and it returns major version 6, minor 0 (as I'd expect for a Vista install).
Has anyone else encountered this problem, know of a fix or have any suggestions of how I might work around it without using JNI?
It might be that Java runs in XP compatibility mode. In that case, Vista will fake the windows version number, making Java believe that it runs on XP. Check the compatibility tab of the executable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With