问题描述:
在Eclipse中运行ant批量打包工具出错,日志信息如下:
D:\Android\android-sdk-windows\tools\ant\build.xml:601: The following error occurred
while executing this line:
D:\Android\android-sdk-windows\tools\ant\build.xml:720: The following error occurred
while executing this line:
D:\Android\android-sdk-windows\tools\ant\build.xml:734: 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 “D:\Program Files\Java\jre7″
解决方案:
Eclipse菜单 – Window – Preferences – Java – Installed JREs – 选中栏目表格中的jre项 – Edit – Add External JARs – 选择jdk目录/lib/tools.jar - 确认其加入JRE system libraries– Finish – OK
本文介绍了解决在Eclipse中使用Ant批量打包工具出现的错误问题,该问题表现为无法找到javac编译器,并提示JAVA_HOME可能未正确指向JDK。通过在Eclipse中为JRE添加外部JAR文件(tools.jar),可以有效解决这一问题。

被折叠的 条评论
为什么被折叠?



