Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-2622

gradle project seams always taken the default JDK

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 11.0
    • Fix Version/s: Next
    • Component/s: projects - Gradle
    • Labels:
      None

      Description

      Hi,
      I start netbeans with JDK 10, set in the `etc/netbeans.conf` the jdkhome path. Now I create a new gradle project and set in the `build.gradle` 

      ```
      sourceCompatibility = 11
      targetCompatibility = 11
      ```

      In my code I use a JDK 11 API like

      ```
      Path p = Path.of(".");
      ```
      This won't compile.

      I added a JDK 11 to netbeans and change under `Properies->Build->Compile->Java Platform` to JDK 11. It still does not compile.
      After a restart, it still does not compile.

      I changed the jdkhome in `etc/netbeans.conf` to the JDK 11. After a restart it compiles.
      Not a big deal, but maybe you should have a look at it. To me it seams like gradle project always takes the default JDK.

        Attachments

        1. netbeans_jdk.png
          180 kB
          Andreas Eberhöfer
        2. JDKTest.tar.gz
          10 kB
          Andreas Eberhöfer

          Issue Links

            Activity

              People

              • Assignee:
                lkishalmi Laszlo Kishalmi
                Reporter:
                andreas.eberhoefer Andreas Eberhöfer
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: