Dmytro Danilenkov
Dmytro Danilenkov

Reputation: 324

How detect version of installed JRE

I'm develop cross-platform standalone application for Win and Mac. Now I'm trying to check version of installed jre during runtime. Is it possible? What are your suggestions?

Upvotes: 0

Views: 81

Answers (2)

Seagull
Seagull

Reputation: 13859

Use System.getProperty("java.version");

Or try to execute java -version.

Upvotes: 1

benjamin.d
benjamin.d

Reputation: 2881

The following

System.getProperty("java.version");

Will give you the version of the jre installed. For a full list of system properties: doc.

Upvotes: 3

Related Questions