Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
551 views
in Technique[技术] by (71.8m points)

ide - Android Studio 'tools.jar' file is not present in classpath

I downloaded the current version of Android Studio (latest as of 4th July 2013) I also downloaded the JDK version 7u25.

However, it displays error after startup: Please ensure JAVA_HOME points to JDK rather than JRE.

I don't know how to solve this problem, which won't let me run the IDE. I would appreciate any help.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Check if java JDK is installed correctly

dpkg --list | grep -i jdk

if not install JDK

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

After the installation you have enable the jdk

update-alternatives --display java

Check if Ubuntu uses Java JDK 7

java -version

If all went right the answer should be something like this:

java version “1.7.0_25″
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) Server VM (build 23.3-b01, mixed mode)

Check what compiler is used

javac -version

It should show something like this

javac 1.7.0_25

Add JAVA_HOME to environment variable

Edit /etc/environment and add JAVA_HOME=/usr/lib/jvm/java-7-oracle to the end of the file

sudo nano /etc/environment

Append to the end of the file

JAVA_HOME=/usr/lib/jvm/java-7-oracle

Log in and out (or reboot) for the changes to take effect.

If you want to remove oracle JDK

sudo apt-get remove oracle-jdk7-installer

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...