While downloading IDE is easy, but getting it up running might not seem so. This might be the case for many who might try with Intellij IDEA or Android Studio on their linux boxes (for example: OpenSUSE or Fedora).
One familiar error statement would be the following:
While starting up Intellij IDE,
JDK Required: ‘tools.jar’ seems to be not in IDEA classpath. Please ensure JAVA_HOME points to JDK rather than JRE.
While starting up Android Studio IDE,
JDK Required: ‘tools.jar’ seems to be not in Android Studio classpath. Please ensure JAVA_HOME points to JDK rather than JRE.
How to reach above situation?
- Download Intellij IDEA from Intellij IDEA Community Edition
- Extract the tar file.
- Open up a command prompt
- cd ideaExtractedFolder/idea/bin
You might see the error statement. How to fix it?
I am taking an example of Fedora workstation. The installables get downloaded in rpm file format. (I had followed steps mentioned in this awesome link ).
- What is missing is JDK, So, go ahead and download one which fits for your system 64 bit or 32 bit rpm file. (You can google: ‘JDK 7 downloads’ you can choose jdk 7 or jdk 8 whichever you want )
- Install rpm using Software (Fedora’s default Software manager, similar to YAST Software Manager on openSUSE)
- Check the directory name of jdk installed: rpm -q jdk
- Go to /usr/java/ . This will contain jdk’s which are installed.
- Go to /usr/java/jdk/1.8.0_51 (assuming you have downloaded jdk1.8). This is the path for your JDK.
- Copy this path now (/usr/java/jdk/1.8.0_51)
- Open up a terminal and do: vi .bash_profile OR vi .bashrc (these contain the bash shell profile settings/configuration settings, where we are going to configure JAVA_HOME variable)
- Add a line: export JAVA_HOME=/usr/java/jdk1.8.0_51
- Save the file (Esc –> :wq)
- Open up another terminal.
- Navigate to your IDE path (cd intellijFolder/bin/) and execute (./idea.sh)
- Now hopefully the IDE will start working properly and you can start coding 🙂