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

前端 未结 14 1476
别那么骄傲
别那么骄傲 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:24

    I had this issue with Environment as :

    • Windows 7
    • Java version jdk1.6.0_33
    • apache-ant-1.6.5

    I Was getting ant build message as "Unable to locate tools.jar. Expected to find it in E:\Java\jre6\lib\tools.jar", where my JDK was installed at E:\Java\jdk1.6.0_33\ and JRE at E:\Java\jre6\

    Cause:

    My issue was that I have ANT_HOME was set twice in the PATH system Environment variable at two different places (means some other variables in between).

    Solution:

    I removed the ANT_HOME variable that pointed to the wrong location and everything worked fine with me.

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

    I once faced the same problem of ant setup. The promotion is just the same as

    Unable to locate tools.jar`. Expected to find it in C:\Program Files\Java\jre6\li b\tools.jar 
    Buildfile: build.xml does not exist! Build failed. 
    

    I deleted all jre path in %PATH% environment and add jdk bin path. Finally I type %ANT_PATH%/bin instead of %ANT_PATH%\bin. It works.

    May help.

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

    you may be using the java in the C:\Windows\system32 directory rather then the installed JDK. I set a JAVA_HOME environmental variable and put %JAVA_HOME%\bin at the start of my path and the problems when away.

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

    I got the same issue. Successfully resolved.

    1. Check your systeminformation that jenkins see : your_jenkins_url/systemInfo
    2. Look for "JAVA_HOME" variable in the "Environment Variables" section. In my case I was not able to found it.

    So if you do not see this variable it means that your variable was not set for the user that jenkins run under. You need to put "JAVA_HOME" in to the "system variables" section of environment variables, not "user variables".

    restart jenkins after this and your problem must be fixed.

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

    Thanks, this also works on Windows 8, x64, using Java x64.

    I didn't want to add all that junk to my system settings so I created a batch file that I'd run just before I wanted to use the Android SDK. Here it is

        set ANDROID_SDK_PT=C:\Program Files\eclipse\sdk\platform-tools
        set ANDROID_SDK_TOOLS=C:\Program Files\eclipse\sdk\tools
        set JAVA_HOME=C:\Program Files\Java\jdk1.7.0_25
        set ANT_HOME=C:\apache-ant
        set PATH=%PATH%;%ANDROID_SDK_PT%;%ANDROID_SDK_TOOLS%;%JAVA_HOME%;%ANT_HOME%\bin
    
    0 讨论(0)
  • 2021-02-04 05:38

    I had the same problem because my JAVA_HOME path was set incorrectly (just like the OP's). It was set to the bin of the jdk.

    So it was set to: C:\Program Files (x86)\Java\jdk1.6.0_25\bin

    When it should have been set to: C:\Program Files (x86)\Java\jdk1.6.0_25

    Updating this environmental variable fixed it for me.

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