I had a new install of 1.0M3  but was baffled by an error report running a
build file with the java and eclipse plugins:

Execution failed for task ':compileJava'.
Cause: 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 "/usr/lib/jvm/java-6-openjdk/jre"

This was odd because java is definitely installed on this path, and
JAVA_HOME is set correctly.

I thought I had one successful build while checking the installation, but
wasn't sure.   I even installed 0.9.2 to double check, and that was the
same.

I used the build.gradle file from the samples/java/quickstart, still the
same.

Eventually I narrowed it down to the structure of the target - I had copied
another java project and it was structured as /src/main/java/com .... and
failed

If I change the structure to either /src/main/com ...  or src/com ... there
is no error.  This is repeatable.

It is not a problem now that I know the cause, but this error message is
misleading - it suggests something very different, perhaps that something
has failed but fallen through to a catch-all exception.

I also found a bug report which looked similar on the STS issue tracker
https://issuetracker.springsource.com/browse/STS-1756, which I have also
commented on.

A great tool though ....

-- 
regards

David

Reply via email to