0

I am looking for my java home directory. When I tried "whereis java" I got java: /usr/share/java but then when I did ls -lah /usr/share/java I got:

total 12K drwxr-xr-x 2 root root 4.0K Aug 13 04:37 . drwxr-xr-x 100 root root 4.0K Aug 13 04:38 .. -rw-r--r-- 1 root root 2.6K Apr 28 15:43 libintl.jar 

Could someone please clue me in?

9
  • did you try echo $JAVA_HOME? Commented Aug 16, 2014 at 17:00
  • Which OS are you using and version? Commented Aug 16, 2014 at 17:07
  • @raffian I tried echo $JAVA_HOME and it came up blank, so I guess it's not set yet. I am using ubuntu version 14.04 Commented Aug 16, 2014 at 17:45
  • ...and you're sure that you've got Java installed? (sudo apt-get install openjdk-7-jdk) Commented Aug 16, 2014 at 19:58
  • try the command which java. It will try to locate the command java in your PATH. The folder /usr/share/java is a jar repository, but seems strangely empty. If you want to check if you have your java installed, try this: dpkg --get-selections | grep -v deinstall | grep openjdk Commented Aug 16, 2014 at 20:09

1 Answer 1

1

The SDK's are located at:

$ ls /usr/lib/jvm default-java java-1.7.0-openjdk-amd64 java-7-openjdk-amd64 

To set JAVA_HOME just point it at default-java (which is just a symlink for selected java version)

$ export JAVA_HOME=/usr/lib/jvm/default-java 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.