Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Ant, Eclipse Config and JRE
Ant, Eclipse Config and JRE [message #54481] Thu, 29 May 2003 13:40 Go to next message
Eclipse UserFriend
Originally posted by: dougr.rmsfinance.com

When I attempt to use ExternalTools:Ant to compile, I get the following
error:
"[javac] BUILD FAILED: file:H:/eclipse/workspace/.../build.xml:118: 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\"

Relevant Info:
[1] running Eclipse version 2.1 on Windows 2000

[2] Java_Home is set to the JDK directory: E:\\j2sdk1.4.1_01

[3] when I execute an Ant Echo Task in Eclipse ( <echo message=\"java.home
= ${java.home}\"/> ), it does indicate that java.home points to the JRE
instead: E:\\j2sdk1.4.1_01\\jre,

[4] I can see that Eclipse gets its information from the Windows Registry
rather than the Windows Environment variables [JAVA_HOME] that Tomcat, Ant
and other java-based programs use. There are JAVAHOME keys for the JDK
and the JRE. I have [a] verified that the JDK and JRE keys point to the
correct locations.

And [b] I have tried to change the JRE key. When I make this change,
Eclipse fails to launch. So I had to change it back.

[5] Environment Variable - Classpath - does contain entry for Tools.jar
which holds the class - com.sun.tools.javac.Main - Ant needs.


How do I configure Eclipse to tell it where Java_Home is so that Ant can
find the class in Tools.jar it needs to compile?

Regards,

Douglas Reames
RMS Finance
919 929 3465
Re: Ant, Eclipse Config and JRE [message #54693 is a reply to message #54481] Thu, 29 May 2003 14:56 Go to previous message
Eclipse UserFriend
> How do I configure Eclipse to tell it where Java_Home is so that Ant can
> find the class in Tools.jar it needs to compile?

You don't...the Ant integration does not use JAVA_HOME.
The error message is coming through from Apache Ant.
Two solutions:
Add the tools.jar to the Ant runtime classpath (in the Ant preferences)
Start eclipse with a JDK install (E:\\j2sdk1.4.1_01) and the tools.jar
will be added to the Ant
runtime classpath automatically.

HTH
Darins
Previous Topic:Eclipse Problems
Next Topic:ANT and memory issue?
Goto Forum:
  


Current Time: Wed Jul 09 04:09:42 EDT 2025

Powered by FUDForum. Page generated in 0.28423 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top