Monday, May 20, 2013

Getting started with Android Studio on Ubuntu 12.04 - tools.jar missing

I tried installing and running Android Studio, but came across the error: "tools.jar missing from classpath. Please ensure that JAVA_HOME points to the JDK, not the JRE."

I tried the following:
Finding where java is installed:
  $: whereisjava
  $: java -version
  $: echo $JAVA_HOME
  $: echo $JDK_HOME

For Ubuntu, normally the openjdk version of Java is used.

Editing and saving ~/.bashrc
$: nano ~/.bashrc
JAVA_HOME =  /usr/lib/jvm/java-7-openjdk-amd64/
export JAVA_HOME
JDK_HOME = /usr/lib/jvm/java-7-openjdk-amd64/
export JDK_HOME

Reloading ~/.bashrc
$: source ~/.bashrc
$: echo $JAVA_HOME
$: echo $JDK_HOME

Check for the correct version of Java if you are like me, having both Java 6 and 7 installed.

sudo update-alternatives --config java

Choose the correct version of Java.


1 comment:

  1. We Provide Best Packers And Movers Greater Noida List for Get Free Best Quotes, Compare Charges, Save Money And Time, Household Shifting Services @ Packers And Movers Greater Noida

    ReplyDelete