Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am a new user of Linux, it has been recommended to me by my friend.

He told me to install software called IntelliJ Idea IDE.

Well I have been following the tutorial. But now when I try to open "idea.sh", an error message pops-up:

'tools.jar' is not in IDEA classpath.
Please ensure JAVA_HOME points to JDK rather than JRE.

Please remember that I'm new to Ubuntu and I'm planning for a nice long stay once I get myself into it :)

Also I do not know if I am running a correct Java6 JDK. When I do java -version, this is what I get:

java version "1.6.0_23"
OpenJDK Runtime Environment (IcedTea6 1.11pre) (6b23~pre10-0ubuntu5)
OpenJDK 64-Bit Server VM (build 20.0-b11, mixed mode)

Thank You for reading this and I hope I will get a nice response.

share|improve this question
    
i solved same problem with this answer, maybe help stackoverflow.com/a/17827697/3057033 –  Erol Guzoğlu Dec 24 '13 at 2:51
add comment

4 Answers 4

Be sure you have a JDK installed on your system.

sudo apt-get install openjdk-7-jdk

If that does not solve your problem, you must tell your system to use that JDK instead of the current JRE. To do so, you choose which JDK/JRE you use by default on your system by executing the following command in terminal.

sudo /usr/sbin/update-alternatives --config java

This command will give you a list of alternative java options, which you will then be able select a JDK instead of JRE.

share|improve this answer
    
This is the correct answer. Thanks. –  N Bhargav Dec 30 '13 at 7:39
    
this helped a lot but now I'm getting: tools.jar' seems to be not in IDEA classpath. Please ensure JAVA_HOME points to JDK rather than JRE. –  advocate Mar 21 at 21:33
    
@advocate I saw your comment on SO; you issue has been resolved by reinstalling JDK, correct? –  allejo Mar 22 at 1:10
2  
yup! just sudo apt-get install openjdk-7-jdk –  advocate Mar 23 at 18:32
add comment

Try this:

sudo apt-get install openjdk-6-jdk

You need JDK.

share|improve this answer
add comment

Try this command

export JAVA_HOME=/usr/lib/jvm/default-java

and run idea.sh again.

Mind you, this only works inside the terminal where you run the command. You will have to set the variable inside .bashrc file. This will enable it on every terminal you open.

StackOverFlow

share|improve this answer
add comment

On my Linux Mint environment I've encountered the same problem. I tried to install Oracle JDK8 using

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer

but the problem remained because installer didn't change environment variables. Then I tried the following

sudo apt-get install oracle-java8-set-default

and it solved the problem

share|improve this answer
add comment

Your Answer

 
discard

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.