Possible Duplicate:
How to know JDK version from within Java code
In my java code I want to check jdk
version. If it is 1.5 or above than & than only I want to go ahead with further execution. How to get the jdk
version ?
Use this condition
Integer.parseInt(System.getProperty("java.version").split("\\.")[1]) >= 5
to check the Java version.
String version = System.getProperty("java.specification.version");
That will give you the string 1.5
for example. Easy to parse.
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