Determine java version used to call a program -


this question has answer here:

i'm trying determine inside application java version used call jar.

i saw solutions talking system.getproperty(java.version), if user have different versions of java, , command this:

c:\absolute\path\to\java\1.5\java -jar something.jar 

is there way know real java version?

you should use system.getproperty("java.version"). give version of currently running jvm string, , can check prefix 1.5 or 1.6, , have version of java.

also check this question, , docs system.getproperty(...).

hope helps.


Comments

Popular posts from this blog

c++ - No viable overloaded operator for references a map -

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - Cannot secure connection using TLS -