After ./studio.sh
in a terminal I get this error \"tools.jar is not in android studio classpath Please ensure JAVA_HOME
points to JDK rather than JRE\"
for openjdk: export JAVA_HOME=/usr/lib/jvm/default-java
but you would better use the oracle jre to run android studio
You must be sure that your jre and jdk works fine.
Run
$ sudo apt-get install default-jre
and then...
$ sudo apt-get install default-jdk
to make sure you have your javac path run
$ whereis javac
It should return something like this:
javac: /usr/bin/javac /usr/bin/X11/javac /usr/share/man/man1/javac.1.gz
If it does not work, you can try change the JAVA_HOME in /etc/enviroment file
Append JAVA_HOME="${/.../JVM_PATH}"
For example:
JAVA_HOME="/usr/lib/jvm/java-7-openjdk-amd64"
and then reload this file:
$ source /etc/environment
Source: link
Although I have JDK installed and was pointing to it, i didn't have java-1.7.0-openjdk-devel installed (Fedora).
Here's how I solved the same problem in my system: Thanks for @user2533809
$sudo apt-get install openjdk-7-jdk
$ls /usr/lib/jvm/java-1.7.0-openjdk-i386
ASSEMBLY_EXCEPTION bin docs include jre lib man THIRD_PARTY_README
$export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-i386
$./studio.sh
Environment :
kesavan@kesavan-Ideapad-Z460:bin$ uname -a
Linux kesavan-Ideapad-Z460 3.2.0-59-generic-pae #0trisquel1 SMP Sat Feb 22 03:55:17 UTC 2014 i686 i686 i386 GNU/Linux
kesavan@kesavan-Ideapad-Z460:bin$
I solved this by installing the jdk. This sounds annoyingly simple but I missed it. I thought I Had installed the jdk, but I had actually installed the jre.
Wrong:
sudo apt-get install openjdk-7-jre
Right:
sudo apt-get install openjdk-7-jdk
As soon as I did that, it started up fine for me. The things we miss sometimes....
I solved the problem combining Jerome's and Jarod's answer:
sudo apt-get install openjdk-7-jdk
sudo nano /etc/environment
adding the following line:JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-i386
Also I just found https://stackoverflow.com/a/17827697/2533809 which seems to have a nice write-up, pretty much the same answer.
(I'm using Debian 7 Wheezy)