问题描述
我收到错误:
C:\dev\ws\springapp\build.xml:81: 找不到 javac 编译器;com.sun.tools.javac.Main 不在类路径上.也许 JAVA_HOME 没有指向 JDK.当前设置为C:\Program Files\Java\jre6"
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 point to the JDK.It is currently set to "C:\Program Files\Java\jre6"
但我已经明确地将我的 JAVA_HOME 设置为 C:\Program Files\Java\jdk1.6.0_14
But I have clearly set my JAVA_HOME to be C:\Program Files\Java\jdk1.6.0_14
ANT 从哪里获得这个值?
Where is ANT getting this value?
推荐答案
当你说你已经清楚地设置"JAVA_HOME 为C:\Program Files\Java\jdk1.6.0_14" - 这就是你看到的从命令行运行set"?我相信如果根本没有设置 JAVA_HOME 的值,Ant 会猜测 JAVA_HOME 的值……您是否可能设置了 JAVAHOME 而不是 JAVA_HOME?
When you say you have "clearly set" JAVA_HOME to "C:\Program Files\Java\jdk1.6.0_14" - is that what you see when you run "set" from the command line? I believe Ant will guess at a value for JAVA_HOME if one isn't set at all... is it possible that you've set JAVAHOME instead of JAVA_HOME?
如果不是这样,我建议您编辑 ant.bat
批处理文件(以及它调用的任何内容 - 我不记得它是否令人费解)以在开始和其他各种有趣的地方.
If it's nothing like that, I suggest you edit the ant.bat
batch file (and whatever it calls - I can't remember whether it's convoluted or not offhand) to print out JAVA_HOME at the start and at various other interesting places.
这篇关于为什么 ANT 告诉我 JAVA_HOME 是错误的,而事实并非如此?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!