1

I have a fresh installation of Android Studio. Keep getting this:

'tools.jar' seems to be not in Android Studio classpath.
 Please ensure JAVA_HOME points to JDK rather than JRE.

How to make it work?

Java version:

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

Javac version:

javac 1.7.0_25

/etc/profile

JAVA_HOME=/usr/local/java/jdk1.7.0_25
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
JRE_HOME=/usr/local/java/jre1.7.0_25
PATH=$PATH:$HOME/bin:$JRE_HOME/bin
export JAVA_HOME
export JRE_HOME
export PATH
2
  • 2
    What does echo $JAVA_HOME give you in a terminal? And did you try to log out and log back in after changing the environment?
    – gertvdijk
    Jul 21, 2013 at 22:15
  • @gertvdijk You are totally right. I didn't log out :/ Sorry for making a fuss... Thank you for pointing it out!
    – lunar
    Jul 21, 2013 at 22:27

1 Answer 1

2

Try to log out and log back in.

After changing the environment settings, you'll have to apply them to your currently running session. If you're in a GUI session (Unity, KDE, Gnome or whatever), this is initiated by your display manager (LightDM, KDM for example) and you'll have to restart your system from there by logging out and back in.

Alternatively, you can change your current user environment in ~/.profile and reload the environment for that terminal by running

source ~/.bashrc

which will load the user .profile file (and changes in the /etc/profile file as well). However, that won't help you if the application you start from the menus requires the updated profile to be applied.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .