JDK Required: ‘tools.jar’ seems to be not in IDEA classpath

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?

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 🙂

JDK Required JDK Required

Advertisements

One thought on “JDK Required: ‘tools.jar’ seems to be not in IDEA classpath”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s