Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have java installed correctly for sure.

aaa@ubuntu:~$ whereis java
java: /usr/bin/java /usr/bin/X11/java /usr/local/java /usr/share/java
aaa@ubuntu:~$ whereis javac
javac: /usr/bin/javac /usr/bin/X11/javac

But when I'm trying to add the location of /usr/bin/java in IntellyJ Idea12 as a java project sdk, I can't do that because it requires the folder and /usr/bin/java is a file. Even if I specify /usr/bin, it says that it's not a valid location.

So where is it located and how do I setup a location to be a java sdk for IntellyJ Idea12 or for Eclipse?

UPDATE: The path "/usr/lib/jvm/" doesn't exist


I used this tutorial

share|improve this question
How did you install jdk, using update-alternatives might help you. – nikhil Mar 13 '13 at 9:00
up vote 11 down vote accepted

All ubuntu JRE and JDK installs gets stored in /usr/lib/jvm/

You need to add the multi-arch specific JDK location to Idea12 For example on 32bit x86 Ubuntu installations use: /usr/lib/jvm/java-7-openjdk-i386

share|improve this answer
The path " /usr/lib/jvm/" doesn't exist. – Alex Malex Mar 13 '13 at 12:31
/usr/lib/jvm/ exist after you have installed the openjdk-7-jdk package. You can see this for yourself if you use the ubuntu package search and search for javac… – xranby Mar 13 '13 at 12:41
didn't I install it? Look at my update2 – Alex Malex Mar 13 '13 at 13:24
You need to use the /usr/local/java/jdk1.7.0_17 if you have followed the tutorial mentioned in UPDATE2.I recommend you to follow the Ubuntu Java help documentation – xranby Mar 13 '13 at 13:31
Thanks. I just ls -lh /usr/lib/jvm/ and discover wich Java. Expected default-javabut found java-7-oracle. Solved. – Magno C Apr 27 at 13:00

whereis locates source/binary and manuals sections for specified files. Then supplied names are first stripped of leading pathname components and any (single) trailing extension of the form .ext, for example,.c. Prefixes of s. resulting from use of source code control are also dealt with. whereis then attempts to locate the desired program in a list of standard Linux places.

java: /usr/bin/java /usr/bin/X11/java /usr/local/java /usr/share/java

That is just a symbolic link of java installation. you can read here

share|improve this answer
and?........... – Alex Malex Mar 13 '13 at 12:30

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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