• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help with Ant build

 
saurav sarkar
Ranch Hand
Posts: 180
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am trying to build a file using Ant in Eclipse IDE.
I am getting the below error.

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


Please help what could be the reason.
I have added tools.jar to the classpath.

Thanks in advance,
Saurav
 
Raghavan Muthu
Ranch Hand
Posts: 3381
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by saurav sarkar:


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



Can you check what is your JAVA_HOME environment variable is set with? It should have been set to the JDK and not its "bin" directory (as the HOME variable implies).

Also, you can have an environment variable called ANT_HOME and set it with the "home" directory where you have extracted "ant" in your drive.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by saurav sarkar:

I have added tools.jar to the classpath.


Where? If I remember correctly, where you *need* to do it is in the Ant preferences inside Eclipse...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic