File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes IDEs, Version Control and other tools and the fly likes Ant in Eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Reply Bookmark "Ant in Eclipse" Watch "Ant in Eclipse" New topic
Author

Ant in Eclipse

Yonghang Cai
Greenhorn

Joined: Apr 22, 2003
Posts: 5
When i use javac task of ant in eclipse,the error happen.
error is :
[javac] BUILD FAILED: file :/eclipse/workspace/MyEJB/build.xml:26: 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
but I use echo to print JAVA_HOME is
[echo] d:\jdk1.4\jre
<echo message="${java.home}" />
how can i do?I want use javac task in eclipse.
Thank u
PS:My eclipse is 2.1
[ April 25, 2003: Message edited by: Yonghang Cai ]
Amol Desai
Ranch Hand

Joined: Jan 29, 2003
Posts: 82
Hi,
Set JAVA_HOME to d:\jdk1.4\ instead of d:\jdk1.4\jre.
Hope it works.Get back if you have any issues
Yonghang Cai
Greenhorn

Joined: Apr 22, 2003
Posts: 5
I can not do it.
If java_home point to jdk folder(use "regedit"),eclipse will not work.
I must copy jre into eclipse folder,but JAVA_HOME be point to jre folder which in eclipse folder.
If I modify JAVA_HOME in environment variable , the JAVA_Home still d:\jdk1.4\jre in ant
How can i do now?
Thanks.
[ April 25, 2003: Message edited by: Yonghang Cai ]
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1177

You need to add 'tools.jar' to ANT runtime classpath in eclipse.
Rene
[ April 25, 2003: Message edited by: Rene Larsen ]

Regards, Rene Larsen
Dropbox Invite
Yonghang Cai
Greenhorn

Joined: Apr 22, 2003
Posts: 5
I can do it.
Thanks Amol Desai and Rene Larsen !
 
 
subject: Ant in Eclipse
 
Threads others viewed
error : Cannot use classic compiler, as it is not available
Problem with Eclipse and the servicegen task of weblogic
Ant unable to find javac compiler (in Eclipse)
Eclipse/Ant Issue - Modern compiler is not available
Within Eclipse - ant javac task and OutOfMemory error.
MyEclipse, The Clear Choice