1

I installed android studio on my laptop .. (OS -> Windows 8) when I try to start it , i get this message "tools.jar' seems to be not in Android Studio classpath . Please ensure you have JAVA_HOME points to JDK rather than JRE"

How can I fix this ? and please can you write the solution in details ? :) .. i'm new to JDK and this stuff .. Thanks in advance :)

user1951755
  • 11
  • 1
  • 3
  • I get the exact same problem except I am on win7. I did install the jdk (in C:\Program Files\Java\jdk1.8.0_25) and I copied/pasted that in the JAVA_HOME env. Same error message. As Android Studio denies starting, I have no access to its user interface to investigate the said classpath. BTW I have a 64 bits version of everything : Android studio, java sdk). – gerard Dec 31 '14 at 14:16
  • Same problem, although the file "tools.jar" is there in subfolder "C:\Program Files\Java\jdk1.8.0_25\lib" – gerard Dec 31 '14 at 14:24
  • I also had the same problem and found this post from Stackoverflow. Solved the issue. [Stack Overflow post](http://stackoverflow.com/questions/27528652/tools-jar-seems-to-be-not-in-android-studio-classpath-on-windows-8) – user1223879 Apr 25 '15 at 14:00
  • maybe this can help any one that commes here - http://stackoverflow.com/questions/27528652/tools-jar-seems-to-be-not-in-android-studio-classpath-on-windows-8 – Mauricio Gracia Gutierrez Sep 26 '15 at 23:49

4 Answers4

1

JRE is the Java Runtime Environment and now that you will be developing code, you need the Java SE Development Kit (JDK) which includes the JRE plus tools that Studio will need to compile your projects. You can get the version you need at http://www.oracle.com/technetwork/java/javase/downloads/. Point JAVA_HOME at the place you install this.

Paul Ratazzi
  • 6,289
  • 3
  • 38
  • 50
  • I have the JDK on my machine and configured it as the comment below but still have the same problem .. – user1951755 Jul 23 '14 at 16:23
  • What is the value of your `JAVA_HOME`? Suggest you echo it in a command tool and then make sure tools.jar is indeed in that path. Maybe your JDK setup is broken? – Paul Ratazzi Jul 23 '14 at 16:27
  • this is the value of JAVA_HOME "C:\Program Files\Java\jdk1.8.0_05" .. what do you mean by putting tools.jar in that path ? sorry ,but how to do that ? :) – user1951755 Jul 23 '14 at 16:31
  • Will Android Studio start at all? If so, use the Terminal inside Studio to check the `CLASSPATH` environment variable. It should have a path equivalent to `$JAVA_HOME\lib\tools.jar`. – Paul Ratazzi Jul 23 '14 at 16:31
  • I was just suggesting that you make sure the file tools.jar is really installed under $JAVA_HOME. It should be in the lib folder. `cd` to that folder and just do a `dir`. – Paul Ratazzi Jul 23 '14 at 16:33
  • it doesn't start at all :( ,, i just gives me the logo of the program before it starts and this message ..but, doesn't start up at all.. – user1951755 Jul 23 '14 at 16:35
  • and yes , i checked it now , and tools.jar is really installed under JAVA_HOME , in lib folder – user1951755 Jul 23 '14 at 16:37
  • There is a possibly related question here: http://stackoverflow.com/questions/16574189/android-studio-installation-on-windows-7-fails-no-jdk-found?rq=1 The solution is to set both `JAVA_HOME` and `JDK_HOME` to the JDK install location. – Paul Ratazzi Jul 23 '14 at 16:37
  • I think i checked it before posting my question .., i think i should re-install the JDK from the beginning and try again .. -_- , Thanks alot for your help :) – user1951755 Jul 23 '14 at 16:38
0

You must be providing wrong path to your JAVA_HOME environment variable. In my machine I have JAVA_HOME configured as follows:

JAVA_HOME   C:\Program Files\Java\jdk1.8.0_05

Note: Dont provide \bin folder.

Illegal Argument
  • 10,090
  • 2
  • 44
  • 61
  • I did exactly like this , and sure about the path .. but still have the same problem .. – user1951755 Jul 23 '14 at 16:24
  • did you copy my path? the java folder could be inside Program Files x86 folder in your machine and jdk folder different. Make sure that your installation of java is correct by using commandline and typeing java command – Illegal Argument Jul 23 '14 at 16:29
  • no no , i didn't copy it .. it's just the same as mine .. , and how to make sure , that the installtion is correct ? , some parts are missing in your comment :) – user1951755 Jul 23 '14 at 16:32
0

Try to enter in the path JAVA_HOME environment variable the jdk not the jre example :

C:\Program Files\Java\jdk1.8.0_20

0

Change JAVA_HOME to JDK, for example:: on Windows 8.1 it can be C:\Program Files\Java\jdk1.8.0_45 . This solution workt for me. Before I had JAVA_HOME point to JRE. You can restart Your system after that for be sure. Then type java --version in cmd

PJak
  • 25
  • 7