Why does ANT tell me that JAVA_HOME is wrong when it is not?

后端 未结 24 980
北恋
北恋 2020-12-07 16:49

I get the error:

C:\\dev\\ws\\springapp\\build.xml:81: Unable to find a javac compiler; com.sun.tools.javac.Main is not on the classpath. Perhaps JAVA_HOME does not

24条回答
  •  借酒劲吻你
    2020-12-07 17:06

    had the same problem;

    c:\jb\src\build.xml:191: Unable to find a javac compiler;
    com.sun.tools.javac.Main is not on the classpath.
    Perhaps JAVA_HOME does not point to the JDK.
    It is currently set to "C:\Program Files\Java\jre7"
    
    Total time: 0 seconds
    
    c:\jb\src>echo %JAVA_HOME%
    c:\Program Files\Java\jdk1.7.0_13
    

    solution:

    path = c:\ant\bin\;%PATH%
    path = c:\Program Files\Java\jdk1.7.0_17\bin;%PATH%
    set "JAVA_HOME=c:\Program Files\Java\jdk1.7.0_13"
    

    I guess the jdk path instruction alone would do it but I'm to lazy to figure it out above solution is bullet proof. :-)

    Also using Windows7

提交回复
热议问题