You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "i-make-robots (via GitHub)" <gi...@apache.org> on 2025/03/14 22:12:48 UTC
[I] Correctly find and use OpenJDK [netbeans]
i-make-robots opened a new issue, #8336:
URL: https://github.com/apache/netbeans/issues/8336
### Description
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:
1) find default installs of openjdk
2) 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.
### Use case/motivation
_No response_
### Related issues
_No response_
### Are you willing to submit a pull request?
No
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [I] Correctly find and use OpenJDK [netbeans]
Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on issue #8336:
URL: https://github.com/apache/netbeans/issues/8336#issuecomment-2726803026
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 2). 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:
```
netbeans --userdir /tmp/tmpusr1
netbeans --userdir /tmp/tmpusr2
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [I] Correctly find and use OpenJDK [netbeans]
Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien closed issue #8336: Correctly find and use OpenJDK
URL: https://github.com/apache/netbeans/issues/8336
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [I] Correctly find and use OpenJDK [netbeans]
Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net commented on issue #8336:
URL: https://github.com/apache/netbeans/issues/8336#issuecomment-2726400263
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! 😄
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [I] Correctly find and use OpenJDK [netbeans]
Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on issue #8336:
URL: https://github.com/apache/netbeans/issues/8336#issuecomment-2789632704
https://github.com/apache/netbeans/pull/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).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [I] Correctly find and use OpenJDK [netbeans]
Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net commented on issue #8336:
URL: https://github.com/apache/netbeans/issues/8336#issuecomment-2726928024
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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [I] Correctly find and use OpenJDK [netbeans]
Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on issue #8336:
URL: https://github.com/apache/netbeans/issues/8336#issuecomment-2726283910
>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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists