How To Fix “tools.jar” Error In Android Studio


After running ./ in a terminal from my Android Studio directory, I get this error below

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


Install JDK:

sudo apt-get install openjdk-7-jdk

Set environment Variable:

sudo nano /etc/environment

Add the following line:


Reboot, and Android Studio starts up. (I had added also a link to to the main menu).

First check if java JDK is installed correctly

dpkg --list | grep -i jdk

if not install by running the commands below:

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

Enable JDK after installation

update-alternatives --display java

Check JDK version

java -version

If everything goes well you should see:


Now add JAVA_HOME to environment variable.

Edit /etc/environment and add JAVA_HOME using your prefered text editor

sudo vi /etc/environment

Now append:

For 32 Bits


For 64 Bits


Now ./ should run