Well, unfortunately gradle init only supports java version specification since Gradle 8.5

NB20 is bundled with Gradle 8.4.

There is a bit workaround needed to run Java 21 projects with Gradle.

Set the Java Runtime version for Gradle in Tools > Options > Java > Gradle to Java 20 or below.

From there you can use any Java version in your Gradle projects, whatever that Gradle version support.

Gradle 8.4 does support Java 21 using Java Toolchain, should work.

java {
    toolchain {
        languageVersion = JavaLanguageVersion.of(21)
    }
}

On 12/3/23 13:30, Ernie Rael wrote:
Running NB-20, jdk21.

The goal is to play with some JDK-21 APIs...

Creating a project using NB's "New Project > Java with Gradle".

I can build and run the default "Library" and test. But there's the warning icon and "Resolve Project Problems".

Any way to get rid of the warning?

-ernie


"Resolve Project Problems"

The Java version: 21, that is selected for the project is not supported by
Gradle 8.4.The IDE will attempt to use Gradle 8.4 to gather the project
information.
Possible solutions:
Upgrade your Gradle version on your project
Select Java Runtime 20 (or below), on Build > Gradle Execution settings, to avoid this problem!




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@netbeans.apache.org
For additional commands, e-mail: users-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@netbeans.apache.org
For additional commands, e-mail: users-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to