Installing IDEA on Ubuntu 11.10

I am trying to install IDEA on Ubuntu 11.10. First, I installed openjdk-7-jdk. Then I tried running the idea.sh file as instructed. However it complains:

ERROR: cannot start IntelliJ IDEA.
No JDK found to run IDEA. Please validate either IDEA_JDK, JDK_HOME or JAVA_HOME 
environment variable points to valid JDK installation.

Press Enter to continue.

Trying to echo these three variables prints an empty line to the screen. How (and to what values) do I set these variables and proceed with the installation? Thanks.


Solution 1:

UPDATE:

It's recommended to use the bundled JetBrains Runtime on Linux to run IntelliJ IDEA. At the moment IntelliJ IDEA requires Java 8 to run on this platform. It's possible to switch to a system or some other Java version, please check the FAQ.


Original answer (obsolete):

It's recommended to use OpenJDK 1.7+ or Oracle JDK to run IntelliJ IDEA on Linux, OpenJDK 1.6 is strictly unsupported because of the known performance and visual issues.

Starting from IntelliJ IDEA 16, custom JRE is bundled with Linux distributions.

The tricky part is that Oracle JDK is no longer distributed via .deb packages and you can't just install it with apt-get or Ubuntu Software Center.

Their site is also confusing and you can easily download JRE instead of the JDK (which will not work as IntelliJ IDEA needs tools.jar that is missing from JRE package).

Here is the correct URL for the JDK downloads (version 1.6.0_29). From this URL download the appropriate .bin file, for example jdk-6u29-linux-i586.bin if you need 32-bit Java or jdk-6u29-linux-x64.bin for 64-bit version.

chmod +x jdk-6u29-linux-i586.bin
./jdk-6u29-linux-i586.bin

to install in the current directory.

Inside bin/idea.sh add the following on the second line:

export IDEA_JDK=/path/to/jdk1.6.0_29

Normally resides under /usr/lib/jvm/<YOUR_JDK>. Now IntelliJ IDEA should start fine under Oracle JDK 1.6.0_29. You can verify it in Help | About.

Solution 2:

You can set JAVA_HOME variable and add to your PATH, by doing the following. As root open up /etc/bash.bashrc and add the following to the end of the file.

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

When you reboot, try running the following:

$ echo $JAVA_HOME

Solution 3:

I have had this problem a few times...

  1. Add the IDEA_HOME/bin to your PATH Make sure JAVA_HOME & other variables are correct.

then run it from the terminal:

$ idea projects-name;

OR 2: navigate into the IDEA_HOME/bin and run it from there.

Solution 4:

i also face a question... in firs day all works without problems, but then... i solve a problem: add to file idea.sh line with path to JDK IDEA_JDK="/opt/java/32/jdk1.6.0_45/"

add after 46 line

Solution 5:

If you had installed java, try:

type java

if you see like this:

java is /usr/java/default/java

then you should edit .bash_profile, add:

export JAVA_HOME=/usr/java/default

then execute:

source .bash_profile

if you did not install java, you should install manual or auto.