Spring Tool Suite
  1. Spring Tool Suite
  2. STS-1756

Problems passing JAVA_HOME to Gradle tasks

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.7.0.M1
    • Fix Version/s: 2.7.0.RC1
    • Component/s: GRADLE
    • Environment:

      Windows

      Description

      User reported a problem because of Java being a JRE on windows:

      http://gradle.1045684.n5.nabble.com/ANN-Gradle-Eclipse-Plugin-tt4387658.html#a4393115

      Not clear at this point why his JAVA_HOME environment variable isn't getting to where the task is trying to call the compiler. Could be that its lost before it even gets to the Eclipse process.

        Activity

        Hide
        Kris De Volder (c) added a comment -

        Note: http://issues.gradle.org/browse/GRADLE-1757 has just been resolved.

        Show
        Kris De Volder (c) added a comment - Note: http://issues.gradle.org/browse/GRADLE-1757 has just been resolved.
        Hide
        Kris De Volder (c) added a comment -

        Hi npace,

        Anything new? Did you figure out what is going on on the machines where you had problems?

        Kris

        Show
        Kris De Volder (c) added a comment - Hi npace, Anything new? Did you figure out what is going on on the machines where you had problems? Kris
        Hide
        npace added a comment -

        Hi Kris,

        Sorry for the delay in responding. Things have been busy lately.

        We never did figure out why this worked on some machines and not others. It's still a problem as of Gradle 1.0M5. Perhaps M6 will fix the issue.

        Thanks.

        Show
        npace added a comment - Hi Kris, Sorry for the delay in responding. Things have been busy lately. We never did figure out why this worked on some machines and not others. It's still a problem as of Gradle 1.0M5. Perhaps M6 will fix the issue. Thanks.
        Hide
        npace added a comment -

        Hi Kris,

        I'm still getting this error. I'm running on Windows 7 and don't have JAVA_HOME set in my environment variables. In eclipse I only have the Java 1.6 JDK installed, not the JRE.

        TOOL VERSIONS:

        Version: Indigo Service Release 1
        Build id: 20110916-0149

        Gradle Tooling Api
        2.9.0.201202032004-SNAPSHOT

        Gradle 1.0-milestone-7

        OUTPUT:

        [sts] -----------------------------------------------------
        [sts] Starting Gradle build for the following tasks:
        [sts] :build
        [sts] -----------------------------------------------------
        :sourcesJar UP-TO-DATE
        :compileJava

        FAILURE: Build failed with an exception.

        • What went wrong:
          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 "C:\Program Files\Java\jre6"
        Show
        npace added a comment - Hi Kris, I'm still getting this error. I'm running on Windows 7 and don't have JAVA_HOME set in my environment variables. In eclipse I only have the Java 1.6 JDK installed, not the JRE. TOOL VERSIONS: Version: Indigo Service Release 1 Build id: 20110916-0149 Gradle Tooling Api 2.9.0.201202032004-SNAPSHOT Gradle 1.0-milestone-7 OUTPUT: [sts] ----------------------------------------------------- [sts] Starting Gradle build for the following tasks: [sts] :build [sts] ----------------------------------------------------- :sourcesJar UP-TO-DATE :compileJava FAILURE: Build failed with an exception. What went wrong: 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 "C:\Program Files\Java\jre6"
        Hide
        Kris De Volder (c) added a comment -

        Yes, I would expect you still have problems with this. There is a solution in the works, but it will require Gradle M8 which is not yet released. See this issue for some more information:
        STS-2276.

        Show
        Kris De Volder (c) added a comment - Yes, I would expect you still have problems with this. There is a solution in the works, but it will require Gradle M8 which is not yet released. See this issue for some more information: STS-2276 .

          People

          • Assignee:
            Kris De Volder (c)
            Reporter:
            Kris De Volder (c)
          • Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              First Response Date: