Skip to content
Advertisement

Where is the Java SDK folder in my computer? Ubuntu 12.04

I know it’s installed because when I type:

JavaScript

I get:

JavaScript

And when I type:

JavaScript

I get:

JavaScript

What worries me about the first item in the list is that the 2012a folder is my MATLAB folder and not a standard ‘usr/lib’ folder. I’m really confused on where the JDK and JRE got installed, because I need to set the $JAVA_HOME path pointing to the folder. Where am I missing something?

Advertisement

Answer

WAY-1 : Updated for the shortest and easy way

Below command will give you the path, But it will only work if java command is working in other words if java path is configured.

JavaScript

Read more at Where can I find the Java SDK in Linux?


WAY-2 (Better than WAY-1) : Below answer is still working and try it if above command is not working for you.

You need to dig into symbolic links. Below is steps to get Java directory

Step 1:

JavaScript

That tells the command java resides in /usr/bin/java.

Dig again:

Step 2:

JavaScript

So, now we know that /usr/bin/java is actually a symbolic link to /etc/alternatives/java.

Dig deeper using the same method above:

Step 3:

JavaScript

So, thats the actual location of java: /usr/local/jre.....

You could still dig deeper to find other symbolic links.


Reference : where is java’s home dir?

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement