Re: gradle: any way to specify JAVA_HOME for use with gradle?

2022-09-11 Thread Ernie Rael

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



Re: gradle: any way to specify JAVA_HOME for use with gradle?

2022-09-11 Thread Scott Palmer
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  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 
>> # 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
> 


RE: Version 15 won't start

2022-09-11 Thread Tim West
Aha, that was the clue.

 

Just upgraded JDK to latest version, reinstalled and all is working okay again.

 

Many thanks for your help.

 

Tim

 

From: Geertjan Wielenga  
Sent: 11 September 2022 12:11
To: Tim West 
Cc: users@netbeans.apache.org
Subject: Re: Version 15 won't start

 

What version of the JDK are you using?

 

Gj

 

On Sun, 11 Sep 2022 at 13:10, Tim West mailto:timw...@milltech.co.uk> > wrote:

Hi,

 

I've been using Netbeans 12.6 for some while and today installed 15 however, 
although the splash screen shows modules loading etc when the main program 
interface opens it is blank and becomes unresponsive.

 

Any ideas how I go about getting version 15 running?

 

Many thanks

 



Re: NB 15 seems to support Gradle Multi-Projects much better!

2022-09-11 Thread Geertjan Wielenga
Excellent, spread the word, Twitter, etc.

Gj

On Sun, 11 Sep 2022 at 13:17, Andreas Reichel <
andr...@manticore-projects.com> wrote:

> Greetings,
>
> just a quick heads-up: my rather complex Gradle Multi-projects are loaded,
> analyzed and executed flawlessly with NB 15.
> (Previous versions struggled with complex Gradle configurations.)
>
> Big thank you and shout out to the Netbeans team! Its time to come back
> and use Netbeans again!
> Cheers and all the best
>
> Andreas
>


RE: Version 15 won't start

2022-09-11 Thread Tim West
Not sure, presumably the one that came as part of the install. 

 

I changed nothing, just installed using the Windows x64 installer.

 

Tim

 

From: Geertjan Wielenga  
Sent: 11 September 2022 12:11
To: Tim West 
Cc: users@netbeans.apache.org
Subject: Re: Version 15 won't start

 

What version of the JDK are you using?

 

Gj

 

On Sun, 11 Sep 2022 at 13:10, Tim West mailto:timw...@milltech.co.uk> > wrote:

Hi,

 

I've been using Netbeans 12.6 for some while and today installed 15 however, 
although the splash screen shows modules loading etc when the main program 
interface opens it is blank and becomes unresponsive.

 

Any ideas how I go about getting version 15 running?

 

Many thanks

 



NB 15 seems to support Gradle Multi-Projects much better!

2022-09-11 Thread Andreas Reichel
Greetings,

just a quick heads-up: my rather complex Gradle Multi-projects are
loaded, analyzed and executed flawlessly with NB 15.
(Previous versions struggled with complex Gradle configurations.)

Big thank you and shout out to the Netbeans team! Its time to come back
and use Netbeans again!
Cheers and all the best

Andreas 


Re: Version 15 won't start

2022-09-11 Thread Geertjan Wielenga
What version of the JDK are you using?

Gj

On Sun, 11 Sep 2022 at 13:10, Tim West  wrote:

> Hi,
>
>
>
> I've been using Netbeans 12.6 for some while and today installed 15
> however, although the splash screen shows modules loading etc when the main
> program interface opens it is blank and becomes unresponsive.
>
>
>
> Any ideas how I go about getting version 15 running?
>
>
>
> Many thanks
>
>
>


Version 15 won't start

2022-09-11 Thread Tim West
Hi,

 

I've been using Netbeans 12.6 for some while and today installed 15 however,
although the splash screen shows modules loading etc when the main program
interface opens it is blank and becomes unresponsive.

 

Any ideas how I go about getting version 15 running?

 

Many thanks