Sterio
Sterio

Reputation: 21

How to get the version of the embedded java

I am implementing GetDown on my application and configure it to embed a JRE to prevent problems of version installed by the users. But I don't find a way to check if the embedded JRE is really the one used, and i can uninstall java on my computer to test it (my employer didn't give me admin access, yay!).

The command System.out.println(System.getProperty("java.version")); show me the java installed on the user's computer, but how can I get what verion of java the application is really using.

Thank you for your answers and sorry for my bad english.

Upvotes: 1

Views: 654

Answers (2)

Sterio
Sterio

Reputation: 21

the command System.out.println(System.getProperty("java.version")); give effectively the version used by the application. It was a bad deduction on my part. At the begining I used the JRE 1.8.0_111, but the command returned 1.8.0_60 without reason (I had the problem even on a computer whithout java instaled).

I have tried changing the embedded JRE (using 1.8.0_172) and now the command return 1.8.0_172 . So i assume the problem was from the previous JRE (1.8.0_111).

Thank you for all your answers, they give me tracks to follow.

Upvotes: 0

Chai T. Rex
Chai T. Rex

Reputation: 3018

System.out.println(System.getProperty("java.version")); doesn't show which Java version is installed on the user's computer, since multiple versions can be installed. It shows which Java version the program is currently being executed on.

Upvotes: 2

Related Questions