Topic: Ant在Eclipse中执行出错?

  Print this page

1.Ant在Eclipse中执行出错? Copy to clipboard
Posted by: jfml
Posted on: 2004-01-02 16:24

在Eclipse下运行ant.xml出错如下,但是如果在cmd中运行ant则成功,请问是什么原因啊?

Buildfile: D:\Eclipse WSP\workspace\XXXClient\build.xml

init:

organize application:
[javac] Compiling 243 source files to D:\Eclipse WSP\workspace\XXXClient\temp\classes
[javac] BUILD FAILED: fileBig Smile:/Eclipse%20WSP/workspace/XXXClient/build.xml:40: 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
Total time: 531 milliseconds

2.Re:Ant在Eclipse中执行出错? [Re: jfml] Copy to clipboard
Posted by: expresso
Posted on: 2004-01-02 16:31

window>preference>java>installed JREs
里添加你的JDK,再选中它就可

3.Re:Ant在Eclipse中执行出错? [Re: jfml] Copy to clipboard
Posted by: jfml
Posted on: 2004-01-02 18:51

这个当然有了,不然我的Java程序都不能运行了

但是Ant就是不行唉

4.Re:Ant在Eclipse中执行出错? [Re: jfml] Copy to clipboard
Posted by: expresso
Posted on: 2004-01-02 19:20

eclipse默认使用的是c:\program下的jre,改成jdk安装目录就可以了,我以前好像也是这个问题,改过来就好了,如果还不行就不解了,

5.Re:Ant在Eclipse中执行出错? [Re: jfml] Copy to clipboard
Posted by: z_wing
Posted on: 2004-01-05 10:16

试试把%JAVA_HOME%\lib\tools.jar加到classpath里!


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923