Wednesday, November 19, 2014

Finding JRE


$Which java

gives us the required information about which JRE ( Java Run Time Environment ) is being used by the current session.

Unfortunately, this is not the case for Windows users.

Luckily, I have few commands to know which JRE version is running.

we all know that JAVA -version gives us the version number. 

But, if you have installed multiple JRE's in your system, which JRE is being used by current session? is big question. 

Java -verbose tells us which jar file is being loaded when we executed this command. 

The output would be like this:

Which clearly shows which rt.jar is being used to load java run time. This is path you need to give in any other application which requires jre folder path.

Few applications such as openOffice Base from Apache, are incompatible with 64-bit JRE. 
When in multiple JRE's installed in a system, to check whether there is any 32-bit jre in your system, run the following command: 
Java -d32 

This command searches for any 32-bit jre in the system, if available, it loads it. Otherwise, throws an error as shown below:

Post a Comment