You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running netbeans-25 for the first time.
Popup tells me to install java >=17 or use command line --jdkhome.
Run netbeans64.exe --jdkhome C:\users\me.jdks\openjdk22.0.2
Quit and run again. Doesn't remember the JDK I used.
Expected behavior:
find default installs of openjdk
remember alt jdks supplied by user. 2a) at least remember one if there are no others available.
Workaround:
Edit the netbeans shortcut to include the --jdkhome param. Forget all about it until the next openJDK update causes confusion/frustration.
Context:
I have installed:
c:\program files\java\jdk-13
c:\program files\java\jdk-15
c:\program files\java\jdk-15.0.1
c:\program files\java\jdk-15.0.2
c:\program files\java\jre1.8.0_441
c:\users\me.jdks\openjdk-21
c:\users\me.jdks\openjdk-21.0.1
c:\users\me.jdks\openjdk-21.0.2
c:\users\me.jdks\openjdk-22
c:\users\me.jdks\openjdk-22.0.1
c:\users\me.jdks\openjdk-21.0.2
I will be removing most of these. Just odd Netbeans couldn't find a single one over 17.
Run netbeans64.exe --jdkhome C:\users\me.jdks\openjdk22.0.2
Quit and run again. Doesn't remember the JDK I used.
this isn't how it is supposed to work. netbeans --jdkhome C:\users\me.jdks\openjdk22.0.2 is passed as regular program argument. Those do not persist.
take a look at etc/netbeans.conf and scroll down. The netbeans_jdkhome property is what you are looking for. Creating a shortcut which would pass the arguments would work too.
To be fair, expected behaviour 1) is a known issue in the launcher. Although if you're using the (now legacy) installer, that has probably set a no longer valid value in conf already, so would override any fix elsewhere. Agreed 2) is not how it's supposed to work though.
The better shortcut workaround is perhaps to use --jdkhome "%JAVA_HOME%\" Note the additional backslash because Windows in its wisdom combines path delimiter and escape character! 😄
yeah the windows launcher is a bit out of date and is known to not look at the right registry entries/paths in some situations. It is currently relying on something, e.g an installer or the user to edit the conf or the program args.
I was referring to
Running netbeans-25 for the first time.
Popup tells me to install java >=17 or use command line --jdkhome.
Run netbeans64.exe --jdkhome C:\users\me.jdks\openjdk22.0.2
Quit and run again. Doesn't remember the JDK I used.
Program args override the config, they don't modify configuration files.
e.g they allow you to run two instances at the same time without having to adjust files:
The point I wanted to make was that shortcuts can use environment variables, so the reporter's workaround can be done once assuming the JDK installations are setting up JAVA_HOME.
#8408 will let the windows launcher handle PATH / JAVA_HOME env vars better.
So depending how you install the JDK, it should be picked up in future. Example: temurin installer will register the JDK in PATH by default (unless you change install settings).
NB will not scan your drive to try to find JDKs though, it takes that information from the program arguments, config file, environment variables or windows registry (in roughly that order).
Activity
mbien commentedon Mar 15, 2025
this isn't how it is supposed to work.
netbeans --jdkhome C:\users\me.jdks\openjdk22.0.2is passed as regular program argument. Those do not persist.take a look at
etc/netbeans.confand scroll down. Thenetbeans_jdkhomeproperty is what you are looking for. Creating a shortcut which would pass the arguments would work too.neilcsmith-net commentedon Mar 15, 2025
To be fair, expected behaviour 1) is a known issue in the launcher. Although if you're using the (now legacy) installer, that has probably set a no longer valid value in conf already, so would override any fix elsewhere. Agreed 2) is not how it's supposed to work though.
The better shortcut workaround is perhaps to use
--jdkhome "%JAVA_HOME%\"Note the additional backslash because Windows in its wisdom combines path delimiter and escape character! 😄mbien commentedon Mar 15, 2025
yeah the windows launcher is a bit out of date and is known to not look at the right registry entries/paths in some situations. It is currently relying on something, e.g an installer or the user to edit the conf or the program args.
I was referring to
Program args override the config, they don't modify configuration files.
e.g they allow you to run two instances at the same time without having to adjust files:
neilcsmith-net commentedon Mar 15, 2025
I should have left the first paragraph out! 😄
The point I wanted to make was that shortcuts can use environment variables, so the reporter's workaround can be done once assuming the JDK installations are setting up JAVA_HOME.
mbien commentedon Apr 9, 2025
#8408 will let the windows launcher handle
PATH/JAVA_HOMEenv vars better.So depending how you install the JDK, it should be picked up in future. Example: temurin installer will register the JDK in
PATHby default (unless you change install settings).NB will not scan your drive to try to find JDKs though, it takes that information from the program arguments, config file, environment variables or windows registry (in roughly that order).