Skip to main content
Stack Overflow
  1. About
  2. For Teams

Return to Question

Source Link
Boann
  • 50.3k
  • 16
  • 125
  • 153

Getting Java version of java inat runtime

I need to write version-independent java code, because of some bugswork around a Java bug in JDK 1.5 which was fixed in JDK 1.6 now i use. I'm using the following condition:

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

Will this work for other JVMs? Is there another possibilitya better way to check this? Will it work for JVM from IBM?

Getting version of java in runtime

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?

Getting Java version at runtime

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?

Source Link
list
  • 2k
  • 2
  • 12
  • 4

Getting version of java in runtime

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?

lang-java

AltStyle によって変換されたページ (->オリジナル) /