Search This Blog

Showing posts with label JRE. Show all posts
Showing posts with label JRE. Show all posts

How to Get JRE installation Directory in a Java Application

To get the java runtime environment (JRE) installation directory of a computer, we can use the getProperty() method in System class. The key to be used for System.getProperty() method to get the java JRE installation directory is "java.home". System.getProperty("java.home") will return the java runtime environment(JRE) installation directory path as a string. the following code will display the jre installation directory path:


System.out.println(System.getProperty("java.home"));