On 9/12/22 7:03 PM, Laszlo Kishalmi wrote:
Try to run NetBeans on Java 11. So the NB JDK17 do not force to use higher Gradle version than your project needs.

Right, that does work.

And never thought I praise the existence of nbjavac...

Thanks for response,
-ernie


On 9/11/22 19:41, Ernie Rael wrote:
Thanks Moacir and Scott,

I ended setting org.gradle.java.home in gradle.properties. command line "gw clean build" works. Was getting exceptions using toolchain, possibly because of my use of non-standard compiler. I'd prefer toolchain and avoid specifying path in gradle.properties.

So I can use jdk-17 at the command line with gradle and it uses jdk-11 and everything works OK.

But running NetBeans with jdk-17 has issues. It doesn't pick up properties correctly and sets the wrong sourceTarget version. But clean/build does work.

-ernie

On 9/11/22 9:10 AM, Scott Palmer wrote:
Perhaps best way to deal with this is to use the Gradle feature to set the tool chain version. In your build.gradle file do this:

|java {toolchain {languageVersion =JavaLanguageVersion.of(17)}}|

See: https://docs.gradle.org/current/userguide/toolchains.html#header

Scott

On Sep 10, 2022, at 11:47 AM, Ernie Rael <err...@raelity.com> wrote:

Thanks Davide, but I wasn't clear about what's going on.

Let's say I run NetBeans with jdk-17. I have some gradle projects that require jdk-11.

So, while running NetBeans with jdk-17, I'd like to work on the gradle projects that require jdk-11.

I set the gradle project's

  ProjectProperties > Build > Compile > JavaPlatform: JDK 11

but that doesn't appear to do anything useful. In addition, I don't see where this property is getting saved; there's no project.properties file, and VCS didn't show any changes.

NetBeans says it tries to understand the gradle build for getting information. When I do a CleanAndBuild there are errors, although jdk-11 is set for the project.

-ernie

On 9/9/22 11:54 PM, Davide Grandi wrote:
I run nb with

SETLOCAL
SET JAVA_HOME=...
START C:\sviluppo\programs\netbeans\14\bin\netbeans64.exe^
 --jdkhome "%JAVA_HOME%"^
 --userdir "C:\sviluppo\user.home\netbeans\14\userdir"^
 --cachedir "C:\sviluppo\user.home\netbeans\14\cachedir"^
 --console suppress^
 -J-Duser.home=C:\sviluppo\user.home^
 -J-Xms4096m^
 -J-Xmx4096m

(because I've multiple jdk but none of them _installed_, all uncompressed)

But there's also a (commented) variable on nb folder :
    ./etc/netbeans.conf
--
# Default location of JDK:
# (set by installer or commented out if launcher should decide)
#
# It can be overridden on command line by using --jdkhome <dir>
# Be careful when changing jdkhome.
# There are two NetBeans launchers for Windows (32-bit and 64-bit) and # installer points to one of those in the NetBeans application shortcut
# based on the Java version selected at installation time.
#
#netbeans_jdkhome="/path/to/jdk"
--

bye,

    Davide

On 10/09/2022 02:42, Ernie Rael wrote:
I must run NB with jdk-11 (or jdk-15 but not the latest LTS).



---------------------------------------------------------------------
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


---------------------------------------------------------------------
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