0

I want to create an Executable Jar file that when run, checks the currently installed version of Java on that computer and displays it for the user. I have searched online but in vain, I cannot find any code that allows a Jar file to check. I know that the Java website has it ( http://www.java.com/en/download/installed.jsp) I can't find a way to replicate it in Java Code. Any help would be very much appreciated.

Note: Sorry if this question is really stupid and has a really simple answer... I just spent half an hour trying to find a solution and I couldn't so I need your help! Thanks

Edit: I don't need the code for displaying it, just to get the version is enough for me thanks!

asked Oct 29, 2013 at 18:15
2

2 Answers 2

5

System.getProperty("java.version");

answered Oct 29, 2013 at 18:17
Sign up to request clarification or add additional context in comments.

1 Comment

Wow so it was so simple, thanks! But I feel really stupid now!
1

Calling System.getProperty("java.version"); will give you version of the installed JRE which is what you want. Also take a look at other System properties, you may find some of them also useful.

answered Oct 29, 2013 at 18:18

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.