how to check jre version using java application

compatibility, java

Solution

You can use System.getProperty(String key); method with `"java.version"` as key.

String version = System.getProperty("java.version");

Example output:

1.6.0_30

The available keys can find at here.

Problem

i have made an application in JDK7, but the jre6 is still using in the market, and if i send my jar file to someone with jre6, it wont work, is there a way that application checks the jre version and if it doesn't compat then ask user to update..

Original source

Related problems