Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » ant build fails: error running javac.exe compiler(ant build)
ant build fails: error running javac.exe compiler [message #548766] Thu, 22 July 2010 22:29 Go to next message
Nilesh is currently offline NileshFriend
Messages: 12
Registered: June 2010
Junior Member
My ant build fails with this error: "error running javac.exe compiler"
Doesn't give me any other information.
javac should be a pretty standard target, shouldn't it?
is it not finding the exe?

What am i missing?

Thanks in advance,
Nilesh

[UPDATE] - installed Ant 1.8.1, tried running ant from command line, got the same error, set JAVA_HOME, and command line worked.
Set eclipse to use Ant 1.8.1, added tools.jar to the classpath, still no dice.
ARRRGH!

[Updated on: Thu, 22 July 2010 23:28]

Report message to a moderator

Re: ant build fails: error running javac.exe compiler [message #548780 is a reply to message #548766] Thu, 22 July 2010 23:56 Go to previous messageGo to next message
Nilesh is currently offline NileshFriend
Messages: 12
Registered: June 2010
Junior Member
Success, finally.

Saw another post - someone asking how to set the JAVA_HOME using the -vm option. The reply was that you can't - it's a bug, because eclipse is looking at a JRE, instead of a JDK.
so i went and changed the path of my "JRE" within eclipse to the JDK, and voila!

I'm absolutely amazed at how people can use this IDE.
I have used IntelliJ happily for years, and have failed time and again to switch to eclipse, because it's such a...
guess it's best to help fix it than complain about it...

have a good day, y'all!
Re: ant build fails: error running javac.exe compiler [message #549391 is a reply to message #548780] Mon, 26 July 2010 14:27 Go to previous messageGo to next message
Eric Rizzo is currently offline Eric RizzoFriend
Messages: 3071
Registered: July 2009
Senior Member
On 7/22/10 7:56 PM, Nilesh wrote:
> Success, finally.
>
> Saw another post - someone asking how to set the JAVA_HOME using the -vm
> option. The reply was that you can't - it's a bug, because eclipse is
> looking at a JRE, instead of a JDK.
> so i went and changed the path of my "JRE" within eclipse to the JDK,
> and voila!
>
> I'm absolutely amazed at how people can use this IDE.
> I have used IntelliJ happily for years, and have failed time and again
> to switch to eclipse, because it's such a...
> guess it's best to help fix it than complain about it...
>
> have a good day, y'all!

Your problem was user error, not a bug. You were using a JRE and
expected Ant to find a javac executable, which simply isn't included in
any JRE.
JAVA_HOME is a Sun-specific thingy that Eclipse chooses not to use
(mostly because system-wide environment variables are a bad idea in
general); as you found, there is an easy way to tell Eclipse about any
number of JREs and JDKs to use to build and run your apps. That
flexibility is powerful and a designed feature.

Eric
Re: ant build fails: error running javac.exe compiler [message #889207 is a reply to message #549391] Tue, 19 June 2012 03:07 Go to previous message
Raymond Phoenix is currently offline Raymond PhoenixFriend
Messages: 1
Registered: June 2012
Junior Member
Eric,
Technically, your reply is accurate. However, a problem that recurs frequently, which causes users dismay and delay, while not a bug, is a problem that 'bugs' people, and should be addressed. A quick search of the web shows that this 'problem' or 'bug' occurs frequently, and the error message is not informative, thus dismay and delay. Is there a chance that the error message could be changed a bit so that the delay would be less?
I'm always hoping for increased user friendliness in every tool I use, even the very best ones. I love the tools that are provided to me; eclipse is excellent.

Ray

[Updated on: Tue, 19 June 2012 03:08]

Report message to a moderator

Previous Topic:eclipse creating AVD view automatically - How to stop?
Next Topic:viewing metamodel
Goto Forum:
  


Current Time: Sun Oct 21 04:37:33 GMT 2018

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

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

Back to the top