Ant “JAVA_HOME does not point to the JDK” - but it does

前端 未结 6 878
终归单人心
终归单人心 2020-12-31 01:23

I cannot run my Ant build.xml since I updated to java 1.7.0_52 (or there about). I have been running it for years through Eclipse locally on my Windows 7 laptop - but with t

6条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-31 01:39

    The real message is that Ant can't find com.sun.tools.javac.Main.

    Which, together with the fact that the latest "Sun" (Oracle) JDK is 1.7.0_13 (or maybe _14, but definitely not the "_52" that your install dir indicates), makes me think that you're not using a distribution that Ant recognizes. You can verify this by running jar tvf $JAVA_HOME/lib/tools.jar, and looking for that class.

    The Ant Manual talks about ways to work with different compilers. Since I've only used "Sun" compilers, I'm afraid that I can't give you any pointers.


    Edit: you could also try setting fork="yes" in your build file. This should run the compiler executable rather than trying to invoke the compiler class.

提交回复
热议问题