The moose likes Ant, Maven and Other Build Tools and the fly likes Ant javac Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Ant javac" Watch "Ant javac" New topic

Ant javac

Suresh Krishna moorthi

Joined: Nov 28, 2011
Posts: 2
I have the following error when i try to create the war file using ANT script in eclipse EE

C:\Documents and Settings\Administrator\workspace\Assignment7\build.xml:67: Unable to find a javac compiler; is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "C:\Program Files\Java\jre6"

Please help me to solve this problem

Thanks advancely.
Nitesh Kant

Joined: Feb 25, 2007
Posts: 1638

This isn't a distributed java question, moving to Ant forum.

apigee, a better way to API!
Tina Smith
Ranch Hand

Joined: Jul 21, 2011
Posts: 208

JDK is different than the JRE; JRE doesn't have a javac executable. You need to point your JAVA_HOME (or PATH) to the JDK which is probably located at "C:\Program Files\Java\jdk1.6.x\bin\"
In that directory you should have a javac executable.

Everything is theoretically impossible, until it is done. ~Robert A. Heinlein
Peter Johnson

Joined: May 14, 2008
Posts: 5852

One correction to Tina's example: don't set JAVA_HOME to the bin directory, set it to, for example, "C:\Program Files\Java\jdk1.6.0_30"

JBoss In Action
I agree. Here's the link:
subject: Ant javac
jQuery in Action, 3rd edition