Link to home
Start Free TrialLog in
Avatar of MarceloAlvim
MarceloAlvim

asked on

Eclipse + Ant

Hi, all!

I'm trying to use ant with eclipse (2.1), and
I like the way the ant plugin integrates one
with the other, but right now I'm having some
problems.

I was making some tests, and all was well, my
classes were being compiled, going to the right
places, everything just fine. Until sometime that
I don't know what happened that when I run
the "build" target, it returns a message:

         build:
         [javac] Compiling 13 source files to
                           C:\Eclipse\workspace\myProject
         [javac] BUILD FAILED: file:C:/Eclipse/
                           workspace/myProject/build.xml:3:
                           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: 331 milliseconds

The only thing I remember doing is changing the compiler
of the javac command to jikes. It didn't work, so I took
off the jikes part and tried to compile ir again... and it
didn't!

I checked my JAVA_HOME variable, and it is right...

My buildfile looks like this:

         <project name="myProject" default="compila">
                 <target name="compila">
                         <javac srcdir="." destdir="." />
                 </target>
         </project>




I would appreciate if anyone had any clue of what should
I do.

thanx,
Alvim.
Avatar of maheshexp
maheshexp

it doen't seems that the problem is in ur XML file, i think it's configuring the compiler...hope u check twice and post what the problem u still get
Avatar of MarceloAlvim

ASKER

i don't know what the problem is, i just put the xml file there 'cause
somebody could ask for it while trying to understand the problem.

the problem is: ant cannot find the javac compiler.

thx
oh, sorry. wrong answer.
if I run ant from outside, that's ok, it compiles.
if I run it from within eclipse, it doesn't.
You might only have the Runtime (JRE) set.  That only has java and javaw--no javac.  Ensure that you have the correct path set for the JSDK.

Tom
ASKER CERTIFIED SOLUTION
Avatar of heppa
heppa
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanx, all, for the help, but it was
just putting tools.jar in my ant runtime
classpath, inside eclipse.

I'm having another problem now, though,
concerning compiling things with jikes.

I'm cancelling this question and posting
that as a new question.

thanx a lot!
oh, well... I don't actually know how to
cancel a question, or even if it is possible,
so I'll just award heppa the points (since
its an answer that solves the problem - only
not exactly as I need), and post my new
question.

thanx, people!
Hi. thx for the points, but you can ask at the community support to close the question, and you get your points back, i agree with that totally;)

GL anyway!

rgds heppa
to close a question , post a comment on closing a question at community support...and they will ask the experts who answered this question and if all accept to close then  the question will be closed
hey just wait.....why u want to close the question...u had accepted answer for the question?
hey, I wanted to close the question BEFORE I accepted the answer.
but, since that was a good answer (only not exactly what I was
looking for), I awarded the points.

but now I know how to close questions, and next time I'll be
able to choose what to do.

but hey, no problems at all!

thanx for the help, all of you.
see ya!