Find user Unix

Where Java Home Unix

If you are working on Linux box and trying to find out where is the location of installed java folder please use below commands:

  • First find if java is installed or not:

$ whereis java
Where Java Home Unix

  • As you see above java command is inside /usr/bin/java but this is not the folder where Java is installed. So let’s do further investigation where java command is linked using /usr/bin/java path:

$ ls -l /usr/bin/java
Where Java Home Unix

  • Now its clear from above that /usr/bin/java -> /etc/alternatives/java is linked.
  • Let’s go further down to check where /etc/alternatives/java is linked:

$ ls -l /etc/alternatives/javaWhere Java Home Unix

  • Finally we found the location of java folder from above is /usr/lib/jvm/java-7-openjdk-i386 because /etc/alternatives/java -> /usr/lib/jvm/java-7-openjdk-i386/jre/bin/java is linked.
  • For more information please refer Unbuntu manual here

Leave a Reply

Your email address will not be published. Required fields are marked *