FIXING com.sun.tools.javac.Main IS NOT ON THE CLASSPATH APACHE ANT COMPILATION ERROR
A few days ago I was setting my development environment up and it involved executing some Apache Ant tasks. I had installed latest Java 7, jdk1.7.0_80 to be exact and Ant 1.8.4, required by the project.
Attempted to compile it and got this output:
The first line logged by Apache Ant hints
tools.jar is missing. The most common cause for this error is to have forgotten to install Java Development Kit (JDK) and/or have JAVA_HOME pointing to an actual Java Runtime Environment (JRE) installation instead of a JDK one, JRE doesn’t ship with
tools.jar, but as it can be observed, the last line of previous output states JAVA_HOME is set to
The problem seems to be that JDK 1.7.0_80 removed
JAVA_HOME/lib, the solution to this issue was to install JDK 1.7.0_76 and update JAVA_HOME accordingly.
If you found this post helpful and would like to receive updates when content like this gets published, sign up to the newsletter.
This website includes affiliate links to Amazon, Google. This means if you click an affiliate link and buy a product, I might earn a commission at no extra cost to you.