netbeans icon indicating copy to clipboard operation
netbeans copied to clipboard

Gradle Project shall use the Java from the tooling not runtime.

Open lkishalmi opened this issue 1 year ago • 9 comments

Gradle Java tooling is the recommended way to set the Java version for source sets since provably version 7.x. Java Tooling has been introduced in Gradle 6.7. In order to be able to split the Java compilation form the java runtime.

NetBeans haven't respected the tooling version from Gradle so far, rlied on that people would use the same tooling as runtime. This really needed to be fixed.

lkishalmi avatar Feb 04 '24 15:02 lkishalmi

The Java Dependencies node in Java projects was removed. image

The Java Platform is displayed per source group in the project Properties Sources: image

lkishalmi avatar Feb 05 '24 07:02 lkishalmi

Did some limited testing on Java 20, and Java 21 as toolchains with Gradle 8.3 and Gradle 8.4 running NetBeans with Java 21

lkishalmi avatar Feb 05 '24 08:02 lkishalmi

I wonder if some more integration with NB IDE would be useful: suggest to install gradle-detected JVMs as java platforms into the IDE, or pass Java platforms configured in the IDE to the gradle build to choose from.

sdedic avatar Feb 05 '24 08:02 sdedic

please make sure that tests don't start to install JDKs

edit: what i mean by that is that existing tests should not suddenly start setting up their own env

mbien avatar Feb 05 '24 18:02 mbien

please make sure that tests don't start to install JDKs

edit: what i mean by that is that existing tests should not suddenly start setting up their own env

This PR has no effect on the existing tests.

lkishalmi avatar Feb 07 '24 03:02 lkishalmi

Would it be possible to retain the java platform node, provided that all source groups share the same JDK setting ? Removal would make the project view inconsistent compared to Maven project view -- there is also "Java Depenendencies" node that shows the JDK.

maven-project

sdedic avatar Feb 19 '24 10:02 sdedic

Well, @sdedic I've put that node back.

image

lkishalmi avatar Feb 26 '24 21:02 lkishalmi

Thanks !

sdedic avatar Feb 26 '24 21:02 sdedic

It seems the paperwork check needs #7117

lkishalmi avatar Feb 27 '24 20:02 lkishalmi

The build is finally green now. If no one objects, I'm going to merge this tomorrow!

lkishalmi avatar Mar 24 '24 03:03 lkishalmi