Apache - Ant - Errors

You were compiling on Windows 7 when suddenly you are getting this error:

[ERROR] com.sun.tools.javac.Main is not on the classpath.
[ERROR] Perhaps JAVA_HOME does not point to the JDK.

Then maybe something like that:

[ERROR] It is currently set to "C:\soft\java32\jdk1.7.0\jre"

So the JRE instead of the JDK?
What's going on?

Ant needs a file named tools.jar that it searches in the JRE but this file is in the JDK!

To resolve this problem, copy:
C:\soft\java32\jdk1.7.0\lib\tools.jar

into:
C:\soft\java32\jdk1.7.0\jre\lib\ext

If it still doesn't work, copy the tool.jar it into:
C:\soft\java32\jre7\lib\ext

Hooray! it works. laugh

Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Refresh Type the characters you see in this picture. Type the characters you see in the picture; if you can't read them, submit the form and a new image will be generated. Not case sensitive.  Switch to audio verification.