开发者

Unable to locate tools.jar [duplicate]

This question already has answers here: Closed 10 years ago.

Possible Duplicate:

Unable to locate tools.jar

I'm tr开发者_JAVA技巧ying to use ant to compile using this command :

 ant compile

I don't know if the problem comes from my windows 64bit, or by something else. Because I have java Installed in the 64 & 32 prog files.

Unable to locate tools.jar [duplicate]

I downloaded apache-ant-1.8.2-bin and putted it in C:\Program Files\apache-ant-1.8.2

I tried to put ant everywhere, I switched also the ENV PATH between java 64 and 32 but everytime I get this error message :

Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre6\lib\tools.jar

I searched for tools.jar in the ant lib folder, in the java 64 and 32, but no trace of it in the system.

What do you think ?


A JRE doesn't have a tools.jar, you need a JDK. Set your JAVA_HOME and PATH variables so that they point to a JDK, not a JRE.


I had similar issue and got solved by doing following ,

1) set JAVA_HOME as C:\Program Files (x86)\Java\jdk1.7.0\

2) ANT_HOME as F:\ant\apache-ant-1.8.4-bin\apache-ant-1.8.4

3) add both to 'path ' in system variables


Please make sure that you are pointing to JDK and not a JRE. For example, you should set JAVA_HOME as "C:\Program Files\java\jdk1.6.0_26" and have %JAVA_HOME%\bin in your system path.


I had to copy C:\Program Files\Java\jdk1.6.0_26\lib\tools.jar to C:\Program Files\Java\jre6\lib\ext

Thanks anyway.


tools.jar comes with JDK, but what happens in your case it looks for it within /Java/jre6. Change JAVA_HOME env var to one of your JDK home.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜