I want to copy some files in the subdirectories of the JVM path , java is already installed. How to know the JVM's path ?

4 Answers 4

locate java

This will give you the location of java installation in your system.

Most probably it would be:


Check your $JAVA_HOME environment variable from a terminal:

  • 2
    This is what I am trying to set using the located path :)
    – milosmns
    Dec 9, 2017 at 0:37

In linux you can use the whereis and which shell commands.

which java
whereis java

which will give you the jre path in /usr/bin folder which will be /usr/bin/java most probably. This is not the actual jre file but it's just a symbolic link to the actual jre file which is located else where. To know the actual jre path you will have to write

readlink -f /usr/bin/java

or whatever was the path of jre returned by which/whereis command.

  • This is the only thing that works.
    – milosmns
    Dec 9, 2017 at 0:39
which java 

This is the simplest command and gives the exact path.

  • 1
    This answer is not correct because it shows the path of the java binary, which will most likely be /usr/bin/java or something of that sort, which is different from the actual path of the JRE.
    – oldmud0
    Jan 19, 2017 at 0:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.