Reputation: 89
I want to configure my PC (Windows 7) so to use phonegap 2.7.0 and create an android application so according this tutorial I m confirured the enviroment variables.
Below are the variables we need on a configuration like this as shown in command prompt:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\Adokis>echo %path%
C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bin\x86
;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\Win
dowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static
; C:\Users\Adokis\Development\adt-bundle-windows-x86_64-20130514\sdk\platform-to
ols;C:\Users\Adokis\Development\adt-bundle-windows-x86_64-20130514\sdk\tools;C:\
Users\Adokis\Development\apache-ant-1.9.0\bin;C:\Program Files\Java\jdk1.7.0_17
C:\Users\Adokis>echo %JAVA_HOME%
c:\Programs Files\Java\jdk1.7.0_17
C:\Users\Adokis>echo %ANT_HOME%
c:\Users\Adokis\Development\apache-ant-1.9.0
C:\Users\Adokis>
The problem is that when I use ant command an error "Unable to locate tools.jar" is shown
C:\Users\Adokis>ant
Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre7\li
b\tools.jar
Buildfile: build.xml does not exist!
Build failed
I double checked all the variables which are correct but I can't figure out why is looking tools.jar at Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre7\lib\tools.jar while the variable is configured at c:\Programs Files\Java\jdk1.7.0_17
Any ideas?
Upvotes: 3
Views: 4112
Reputation: 948
Had the same problem. My mistake was I have included /bin folder for JAVA_HOME environment variable.
Upvotes: 2
Reputation: 19388
Download and install the Java JDK (http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html) instead of the JRE.
Once this is done you may need to change the %JAVA_HOME% environment variable. I'm not sure if the JDK installer does that for you.
The file tools.jar is not included in the JRE as it's only the "Runtime Environment" and not the "Development Kit".
Also, check the values of CLASS_PATH
and JAVA_LIB
as Ant may be using them instead of JAVA_HOME
.
Upvotes: 3