IntelliJ Java IDE
The moose likes Ant, Maven and Other Build Tools and the fly likes Ant javac Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Reply Bookmark "Ant javac" Watch "Ant javac" New topic
Author

Ant javac

Suresh Krishna moorthi
Greenhorn

Joined: Nov 28, 2011
Posts: 2
Hi
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;
com.sun.tools.javac.Main 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
Bartender

Joined: Feb 25, 2007
Posts: 1629

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: 112

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
author
Bartender

Joined: May 14, 2008
Posts: 4875

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
 
 
subject: Ant javac
 
Threads others viewed
problem when buikding with ant in j2ee tutorial
Compilation error while building the project using Ant
Sun's J2EE tutorial
Javac compile error
Javac error
MyEclipse, The Clear Choice