Getting version of java in runtime

Posted by list on Stack Overflow See other posts from Stack Overflow or by list
Published on 2010-04-07T08:56:57Z Indexed on 2010/04/07 9:03 UTC
Read the original article Hit count: 213

Filed under:
|

I need to write version-independent java code, because of some bugs in JDK 1.5 which was fixed in JDK 1.6 now i use the following condition:

if (System.getProperty("java.version").startsWith("1.5.")) {
...
} else{
...
}

Is there another possibility to check this? Will it work for JVM from IBM?

© Stack Overflow or respective owner

Related posts about java

Related posts about runtime