Ant + Vista 64 : “Unable to locate tools.jar” (jre/jdk conflict?)

前端 未结 14 1477
别那么骄傲
别那么骄傲 2021-02-04 05:10

I\'m trying to use ant in a vista 64 environment to build some docbook/xml files.

However, I can\'t resolve this error message. Anybody have suggestions?

C:\\U

相关标签:
14条回答
  • 2021-02-04 05:38

    why don't you try the 32 bit version. there could be a problem between the two versions you have installed being 32 and 64. try the 32 bit version so ur not seeing any 64 bit versions.

    it should fix ur problem.

    0 讨论(0)
  • 2021-02-04 05:38

    I was getting a "C:\Program" is not recognized as an internal or external command, operable program or batch file error, when running %ANT_HOME%\bin\ant.bat

    I found that I needed to wrap the command in double-quotes in order to get the proper escaping to happen on the path string.

    FIX: "%ANT_HOME%\bin\ant.bat" --NOT-- %ANT_HOME%\bin\ant.bat

    Hope that helps!

    0 讨论(0)
  • 2021-02-04 05:40

    I had this problem on a 64-bit Windows 7 machine and Ant 1.8.2. The solution was to use the admin tools mentioned by #bigfix to set the environment variables. Follow the Ant installation instructions for Windows. But do not set the path as %ANT_HOME%\bin. Instead, use an explicit path such as C:\jdk-1.5.0.05\bin.

    My first test failed because my command window was already open and using the old env vars. Close it and open a new one. Then try the test. It worked for me.

    0 讨论(0)
  • 2021-02-04 05:41

    I solved the problem by creating system variable JAVA_HOME to C:\Program Files\Java\jdk1.6.0_25. Don't put the semi colon after it. First of all I put the semi colon and there was an error. I removed the semi colon and it worked.

    0 讨论(0)
  • 2021-02-04 05:43

    I am going to add one other issue that I had with this.

    BTW, the answer here worked for me too. I had to point my java directory to the specific SDK version. Thank you very much.

    But I'm going to add that I had to install the SDK as an administrator, or it didn't extract tools.jar. I found this answer elsewhere, and I hope it helps someone to repeat it here.

    0 讨论(0)
  • 2021-02-04 05:46

    All you need is to set JAVA_HOME path in your environment. In Windows 7 go to "System Properties -> Advanced -> Environment Variables" and add JAVA_HOME. The value in my case was:

    C:\Program Files\Java\jdk1.7.0_07

    This resolved the issue for me. This variable points Ant to the correct Java location.

    0 讨论(0)
提交回复
热议问题