com.sun.tools.javac.Main is not on the classpath

Feb 08 2010 Published by under Java

I get the following error when I run ant script.

com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to “d:\devtools\java1.5\jre”

I have everything set right – the java home pointing to java 1.5 jdk and tried google, none of the solutions mentioned in the forums worked for me.

I removed the endorsed folder from java_home/jre/lib and it worked.

Now the confusing part is – when I use java 1.6 as JAVA_HOME it works even with the endorsed folder.

No responses yet

Leave a Reply