Which JRE am I using?

There are two varieties of JRE available. Java VM: IBM vs. Sun. Is there a way to know which JRE I am using through JavaScript or some Java issued command.

31.6k 22 22 gold badges 109 109 silver badges 132 132 bronze badges asked Dec 12, 2011 at 9:19 1,915 1 1 gold badge 15 15 silver badges 16 16 bronze badges

10 Answers 10

The following command will tell you a lot of information about your java version, including the vendor:

java -XshowSettings:properties -version 

It works on Windows, Mac, and Linux.

31.6k 22 22 gold badges 109 109 silver badges 132 132 bronze badges answered Mar 19, 2015 at 20:08 Ernesto Iser Ernesto Iser 2,594 2 2 gold badges 14 14 silver badges 18 18 bronze badges

I don't know why people are not voting this one higher since it is the easiest to accomplish in windows and linux. Do you know if it works on Mac?

Commented Jun 10, 2015 at 20:56 Thanks for your comment, I just tried it on my mac and it doesn't work, good catch Commented Jun 10, 2015 at 20:57

This command reports Oracle as my Java vendor in my Ubuntu system, despite it being OpenJDK actually.

Commented Nov 3, 2015 at 11:58

@clapas could you please post the version of ubuntu that you are running and the command you used to install java? thanks

Commented Nov 4, 2015 at 20:05 @ErnestoIser Ubuntu 14.04. I installed Java through apt-get. Commented Nov 5, 2015 at 12:19
 System.out.println(System.getProperty("java.vendor")); System.out.println(System.getProperty("java.vendor.url")); System.out.println(System.getProperty("java.version")); Sun Microsystems Inc. http://java.sun.com/ 1.6.0_11 
answered Dec 12, 2011 at 9:28 1,489 11 11 silver badges 15 15 bronze badges This doesn't distinguish Oracle JRE from OpenJDK - see this answer Commented Mar 5, 2019 at 12:08
  1. Open up your:
  2. Type in:
java -version // This will check your JRE version javac -version // This will check your Java compiler version if you installed the JDK 
31.6k 22 22 gold badges 109 109 silver badges 132 132 bronze badges answered Dec 12, 2011 at 9:42 chaos_faction chaos_faction 369 2 2 silver badges 3 3 bronze badges This just gets version, not JRE vendor Commented Jan 11, 2016 at 20:28 This does't tell anything about the vendor of your java version, that's the objetive of the question Commented Feb 15, 2016 at 15:29
java -version 
java.exe -version 

If you need more info about the JVM you can call the executable with the parameter -XshowSettings:properties . It will show a lot of System Properties. These properties can also be accessed by means of the static method System.getProperty(String) in a Java class. As example this is an excerpt of some of the properties that can be obtained:

$ java -XshowSettings:properties -version [. ] java.specification.version = 1.7 java.vendor = Oracle Corporation java.vendor.url = http://java.oracle.com/ java.vendor.url.bug = http://bugreport.sun.com/bugreport/ java.version = 1.7.0_95 [. ] 

So if you need to access any of these properties from Java code you can use:

System.getProperty("java.specification.version"); System.getProperty("java.vendor"); System.getProperty("java.vendor.url"); System.getProperty("java.version"); 

Take into account that sometimes the vendor is not exposed as clear as Oracle or IBM. For example,

$ java version "1.6.0_22" Java(TM) SE Runtime Environment (build 1.6.0_22-b04) Java HotSpot(TM) Client VM (build 17.1-b03, mixed mode, sharing) 

HotSpot is what Oracle calls their implementation of the JVM. Check this list if the vendor does not seem to be shown with -version .

31.6k 22 22 gold badges 109 109 silver badges 132 132 bronze badges answered Dec 12, 2011 at 9:21 Francisco Puga Francisco Puga 24.9k 6 6 gold badges 50 50 silver badges 66 66 bronze badges

java version "1.6.0_22" Java(TM) SE Runtime Environment (build 1.6.0_22-b04) Java HotSpot(TM) Client VM (build 17.1-b03, mixed mode, sharing)

Commented Dec 12, 2011 at 9:24 when you see hotspot, it's Sun Java. Sorry, it's Oracle Java now. Commented Dec 12, 2011 at 9:29

The Java system property System.getProperty(. ) to consult is "java.runtime.name" . This will distinguish between "OpenJDK Runtime Environment" and "Java(TM) SE Runtime Environment". They both have the same vendor - "Oracle Corporation".

This property is also included in the output for java -version .

answered Mar 5, 2019 at 12:05 38.4k 16 16 gold badges 131 131 silver badges 213 213 bronze badges

Open a command prompt:

 Version: java -version Location: where java (in Windows) which java (in Unix, Linux, and Mac) 

To set Java home in Windows:

Right click on My computerPropertiesAdvanced system settingsEnvironment VariableSystem VariableNew. Give the name as JAVA_HOME and the value as (e.g.) c:\programfiles\jdk

Select Path and click Edit , and keep it in the beginning as: %JAVA_HOME%\bin; . remaining settings goes here

JAVA_HOME

31.6k 22 22 gold badges 109 109 silver badges 132 132 bronze badges answered Aug 13, 2017 at 2:41 3,696 18 18 gold badges 48 48 silver badges 62 62 bronze badges thx for bringing up the connection between windows environment variables and the used binaries Commented Feb 19, 2020 at 11:41 Six years after the question was asked and this does absolutely nothing to answer the question. Commented Nov 2, 2021 at 12:21

Git Bash + Windows 10 + Software that came bundled with its own JRE copy:

Do a "Git Bash Here" in the jre/bin folder of the software you installed.

Then use "./java.exe -version" instead of "java -version" to get the information on the software's copy rather than the copy referenced by your PATH environment variable.

Get the version of the software installation: ./java.exe -version

JMIM@DESKTOP-JUDCNDL MINGW64 /c/DEV/PROG/EYE_DB/INST/jre/bin $ ./java.exe -version java version "1.8.0_131" Java(TM) SE Runtime Environment (build 1.8.0_131-b11) Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode) 

Get the version in your PATH variable: java -version

JMIM@DESKTOP-JUDCNDL MINGW64 /c/DEV/PROG/EYE_DB/INST/jre/bin $ java -version java version "10" 2018-03-20 Java(TM) SE Runtime Environment 18.3 (build 10+46) Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10+46, mixed mode) 

As for addressing the original question and getting vendor information:

./java.exe -XshowSettings:properties -version ## Software's copy java -XshowSettings:properties -version ## Copy in PATH