I need to work around a Java bug in JDK 1.5 which was fixed in 1.6. I'm using the following condition:
if (System.getProperty("java.version").startsWith("1.5.")) {
...
} else {
...
}
Will this work for other JVMs? Is there a better way to check this?
These articles seem to suggest that checking for 1.5
or 1.6
prefix should work, as it follows proper version naming convention.
java.version
system property"java.version
system property"