Loading...
Logo
Processing Forum
I moved from my mac to a pc and i want to be able to compile a library.
I get this error:


BUILD FAILED
C:\Documents and Settings\Sjoerd\workspace\PPath\resources\build.xml:107: The following error occurred while executing this line:
C:\Documents and Settings\Sjoerd\workspace\PPath\resources\build.xml:141: 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"
107
        <antcall target="compile" />


141
        <javac srcdir="${project.tmp}/${project.name}/src" destdir="${project.bin}" source="${java.target.version}" target="${java.target.version}" includeantruntime="false">

Does someone know how to fix?

Replies(5)

The message is quite clear; the variable JAVA_HOME as defined in your user PATH variable is set to the JRE, not the JDK.
fixing was quite some work, there are a lot of different solutions online.
The thing that worked for me.
I had to download jdk, and then not the latest but a older version.
Then add the tools.jar to the ant thing, can't remember out of my head how.
new windows same fucking problem blargh.
Even getting eclipse to work was a pain.

anyway i removed jre from here as a attempt



but this is not good, it can not find java.util.ArrayList; for example.
How can i get it back?
Click on Add Library, then choose JRE System Library.
thx, ok solved it.

this time i solved it with:

1) In Eclipse click Run->External Tools->External Tools Configurations
2) Click JRE tab
3) Click Installed JREs... button
4) Click Add button (select Standard VM, where applicable)
5) Click Directory Button
6) Browse to your JDK version (not JRE) of your installed Java (eg: C:\Program Files\Java\jdk1.7.0_04)
7) Click Finish.
8) Re-run Ant script - have fun!

previous time i did it different.
java sucks.