Fix empty Java SE platform dialog when no compatible JDK is installed#9445
Fix empty Java SE platform dialog when no compatible JDK is installed#9445renatsaf wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
given that JDK 27 will be released during the lifetime of NB31 we could be one step ahead of the next bug report by optimistically assuming that everything which supports 26 today will also support 27 once its released.
feel free to update the other GlassFishVX.xml files too add 27 too and squash everything into one commit + force push.
also: I don't really know how to handle LLM assisted contributions yet, so I started a thread at the dev list https://lists.apache.org/thread/qhr3mfxg5wsv89d80nxzdd63ldjth07p. Based on the result you might have to update the PRs you opened. (but it might also be fine as is)
d2bbf97 to
cc0a60e
Compare
|
Done — added One note while doing it: a |
|
I use the recommended range as per the release notes from every GlassFish release e.g. GlassFish 7.1.0 In some cases the the is no range, but this release also indicate:
Before merging please test the functionality of GF 7.1.0 and 8.0.0 with Java 26/27. |
@pepness you are right. I naively assumed that this was tested before the PR was created. 8.0.3 does only start on JDK 25 and below. (in past, glassfish could be often used to experiment with newer JDKs even though it wasn't officially supported yet) Detailsclassic asm update issue: |
…#9423) When the JDK chosen to launch GlassFish is unsupported and none of the installed Java SE platforms match the server's supported range, the "select a Java SE platform" dialog showed an empty combo box, a generic "please select another platform" warning, and only a Cancel button - leaving the user with no way forward. Detect the empty case and show a message that names the supported Java SE range and points at the existing "Manage Platforms" button, which already re-enables OK once a compatible JDK is registered. A new JavaUtils.supportedJavaSERange(instance) helper derives the range from the server's config. The earlier approach of advertising JDK 26/27 in the GlassFish 7.1/8.0 configs was dropped: GlassFish 8.0.x does not actually boot on JDK 26 (asm/OSGi resolution failure), so listing those would only replace the empty dialog with a server that fails to start. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
cc0a60e to
a2176a9
Compare
|
You're both right — thanks for actually testing. I'd wrongly assumed the empty dropdown was purely a config/enum sync gap; I hadn't verified that GlassFish itself boots on JDK 26, and it doesn't (the asm OSGi So I've dropped the 26/27 additions (and the I did not build NetBeans locally for this change, so a quick check of the dialog wording on your side would be appreciated. (Also still watching the dev-list thread on LLM-assisted contributions — happy to adjust presentation based on where that lands.) |
Fixes #9423
Problem
On a machine whose only registered JDK is unsupported by the target GlassFish
server (e.g. JDK 26 with GlassFish 8.0, which supports 21–25), starting the
server pops up the "select a Java SE platform" dialog with an empty platform
dropdown, a generic "please select another platform" warning, and only a
Cancel button — a dead end, since there is nothing to select.
Fix
Detect the empty-supported-platforms case in
JavaSEPlatformPaneland show amessage that:
That button already re-runs
findSupportedPlatformsand re-enables OK once acompatible JDK is registered, so the dialog becomes actionable instead of a dead
end. A small
JavaUtils.supportedJavaSERange(instance)helper derives the rangefrom the server config.
Why not just add JDK 26/27 to the configs (the original approach)
The first revision of this PR added
<platform version="26"/>/27to theGlassFish 7.1/8.0 configs. As @pepness and @mbien pointed out (and verified),
GlassFish 8.0.x does not actually boot on JDK 26 — it fails with the classic
asm/OSGi resolution error (
osgi.ee=JavaSE;version=1.5.0). Advertising 26/27would only trade the empty-dialog bug for a "server dies at startup with a
cryptic OSGi trace" bug. Once a GlassFish release genuinely boots on JDK 26,
bumping the config is a one-line follow-up.
🤖 Generated with Claude Code