Eclipse: Ant no com.sun.tools.javac.Main ?

From: P.Hill (goodhill_at_xmission.com)
Date: 01/21/04


Date: Tue, 20 Jan 2004 21:54:34 -0700

Somehow I can't compile in Eclipse ANT any more, but
I can compile in ANT from the command line.

I thought my eclipse project was working, but I did an update of my JDK
(via the automatic update feature of the windows install)
and something is broken, but I don't know if the two events are related.

So here is what I get in my Eclipse Console.
<quote>
[javac] BUILD FAILED: file:C:/dev/workspace/myLogon/WEB-INF/src/build.xml:54:
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
</quote>

Looking at the JDK configured it is:
Standard VM
j2SDK1.4.1_03
C:\Program Files\j2sdk1.4.2_03
with all 5 libraries from
C:\Program Files\j2sdk1.4.2_03\jre\lib\*.jar
and all 4 libraries from
C:\Program Files\j2sdk1.4.2_03\jre\lib\*.jar
on the classpath 'JRE System Libraries' (as shown in the Edit JRE window)

But I notice that I can find the
com.sun.tools.javac.Main in
C:\Program Files\j2sdk1.4.2_03\lib\tools.jar
(Notice no JRE in this last path)
but adding that to the JRE system libraries didn't help

The java command works at the command line
The javac command works at the command line
ant works fine from the command line.
JAVA_HOME appears to be the same as in the JRE configured in Eclipse
C:\Program Files\j2sdk1.4.2_03
and the path includes that plus bin.

What is Eclipse using when creating an Ant process that is
messing up the default JDK configuration?
How would I fix it?



Relevant Pages

  • Re: Changing IDE = Ton Of Work
    ... > If eclipse has ant support, ... I will just continue my file layout to get Eclipse happy. ... "right" place in the file system. ... I could have apples.java somewhere crazy and JBuilder wouldn't care so ...
    (comp.lang.java.programmer)
  • Re: Eclipse vs. GetResourse
    ... I'm waiting for an IDE ... > Eclipse can invoke any ANT task. ...
    (comp.lang.java.softwaretools)
  • RE: More Info About $| = 1;
    ... Might it have something to do with Eclipse? ... use strict; ... use warnings; ... the command line does nothing until I enter some text, ...
    (perl.beginners)
  • Compilieren mit Eclipse und ANT
    ... ich habe in Eclipse 3.2 ein dynamisches Web-Projekt angelegt und Sourcen ... In Eclipse wird kein Fehler gemeldet, aber wenn ich den ANT-Task(in Eclipse ... Ich vermute, dass ich ANT sagen muss, welche Compiler Version genutzt werden ... Unter Run an Ant buildfile ist bereits eingestellt: Run in the same JRE as ...
    (de.comp.lang.java)
  • Re: Giving an application a window icon in a sensible way
    ... Well, I was under the impression that you hadn't been able to get Eclipse to build the JAR file for you as part of an atomic, automated build. ... The main reason that I like to use Ant for the build rather than the IDE's built-in mechanism is because it stops you from being tied to the IDE. ... This is advantageous for integrating with other processes, such as continuous integration systems. ...
    (comp.lang.java.programmer)