System.out.println(System.getProperty("java.home"));
Tutorials, tips and tricks about java programming language. Answers for many doubts about java programming language. Answering many howtos. Sample java projects and source code, java games, java programs for java practical labs.
Search This Blog
Showing posts with label JRE directory. Show all posts
Showing posts with label JRE directory. 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:
Subscribe to:
Posts (Atom)