I know that once
STS-2213 is implemented this would be simpler to address. However, the current situation seems to have a foundamental problem.
Working in Windows 7 64-bit with 64-bit Eclipse. eclipse.ini specifies the parameter -vm "C:/Program Files/Java/jre6/bin/javaw.exe" (this is a JRE), while the JAVA_HOME environment variable is set to "C:\Program Files\Programmazione\Java\jdk1.6.0_22" (this is a JDK).
When I try to run a Gradle task with the External Tools Configuration, I get the following incoherent output:
So, while it first says that the JAVA_HOME is set correctly, once it has to start compiling it complains it is not, because it seems like it's using the "-vm" Eclipse command line argument to resolve the Java location instead of the JAVA_HOME environment variable.
This said, if I try to remove the JAVA_HOME environment variable and start Eclipse with a JDK (specifying -vm "C:\Program Files\Programmazione\Java\jdk1.6.0_22" command line argument, so overriding what's specified in the eclipse.ini), I get the following output:
(plase note that I've checked that the -vm argument was taken up correctly by Eclipse, by looking at Help | About Eclipse Platform | Installation Details | Configuration)
This makes me wonder where the hell is the daemon taking that value for the JAVA_HOME environment variable... The only thing I can think of is that my system-wide registered JRE (i.e.: the one that is launched if I open a Command Prompt and type "java -version") is located in "C:\Program Files\Java\jre6" and that the Gradle daemon is taking this by looking at the java.home system property returned by that Java instance.
So I'm stuck, I don't know how to make Gradle compile when launched from within Eclipse...