Skip to content

Fix empty Java SE platform dialog when no compatible JDK is installed#9445

Draft
renatsaf wants to merge 1 commit into
apache:masterfrom
renatsaf:glassfish-jdk26-config
Draft

Fix empty Java SE platform dialog when no compatible JDK is installed#9445
renatsaf wants to merge 1 commit into
apache:masterfrom
renatsaf:glassfish-jdk26-config

Conversation

@renatsaf

@renatsaf renatsaf commented Jun 16, 2026

Copy link
Copy Markdown

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 JavaSEPlatformPanel and show a
message that:

  • names the Java SE range the server actually supports, and
  • points the user at the existing Manage Platforms button.

That button already re-runs findSupportedPlatforms and re-enables OK once a
compatible JDK is registered, so the dialog becomes actionable instead of a dead
end. A small JavaUtils.supportedJavaSERange(instance) helper derives the range
from 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"/> / 27 to the
GlassFish 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/27
would 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

@mbien mbien added Java EE/Jakarta EE [ci] enable enterprise job enterprise [ci] enable enterprise job labels Jun 16, 2026

@mbien mbien left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

@renatsaf renatsaf force-pushed the glassfish-jdk26-config branch from d2bbf97 to cc0a60e Compare June 17, 2026 09:44
@renatsaf renatsaf changed the title Add Java SE 26 platform to GlassFish 7.1 and 8.0 server configs Add Java SE 26 and 27 platforms to GlassFish 7.1 and 8.0 server configs Jun 17, 2026
@renatsaf

Copy link
Copy Markdown
Author

Done — added version="27" to both configs and squashed to a single commit (force-pushed).

One note while doing it: a <platform version="N"/> entry is actually inert without a matching JavaSEPlatform enum constant — JavaSESet.platforms() drops unknown version strings via toValue (returns null), and the installed JDK's spec version is itself resolved through JavaSEPlatform.toValue in JavaUtils.findSupportedPlatforms. So adding version="27" to the XML alone wouldn't have done anything. I added the v27 enum constant alongside the config entries so 27 is genuinely recognized — and so the enum and config stay in sync, since that asymmetry is exactly what caused this bug. Left the older GlassFishV7_0_* configs untouched as you indicated.

@pepness

pepness commented Jun 18, 2026

Copy link
Copy Markdown
Member

I use the recommended range as per the release notes from every GlassFish release e.g.

GlassFish 7.1.0
Supported JDK range changed from 11-21 to 17-25.

In some cases the the is no range, but this release also indicate:

Fixed compatibility with Java25 + updates

Before merging please test the functionality of GF 7.1.0 and 8.0.0 with Java 26/27.

@mbien mbien added the ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) label Jun 20, 2026
@mbien

mbien commented Jun 20, 2026

Copy link
Copy Markdown
Member

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)

Details

classic asm update issue:

ERROR: Bundle org.objectweb.asm [13] Error starting file:/home/mbien/dev/servers/glassfish803/glassfish/modules/asm.jar (org.osgi.framework.BundleException: Unable to resolve org.objectweb.asm [13](R 13.0): missing requirement [org.objectweb.asm [13](R 13.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=1.5.0)) Unresolved requirements: [[org.objectweb.asm [13](R 13.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=1.5.0))])
org.osgi.framework.BundleException: Unable to resolve org.objectweb.asm [13](R 13.0): missing requirement [org.objectweb.asm [13](R 13.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=1.5.0)) Unresolved requirements: [[org.objectweb.asm [13](R 13.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=1.5.0))]
	at OSGi//org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4398)
	at OSGi//org.apache.felix.framework.Felix.startBundle(Felix.java:2308)
	at OSGi//org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1566)
	at OSGi//org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:297)
	at java.base/java.lang.Thread.run(Thread.java:1516)

@mbien mbien marked this pull request as draft June 20, 2026 13:17
…#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>
@renatsaf renatsaf force-pushed the glassfish-jdk26-config branch from cc0a60e to a2176a9 Compare June 20, 2026 14:31
@renatsaf renatsaf changed the title Add Java SE 26 and 27 platforms to GlassFish 7.1 and 8.0 server configs Fix empty Java SE platform dialog when no compatible JDK is installed Jun 20, 2026
@renatsaf

Copy link
Copy Markdown
Author

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 osgi.ee=JavaSE;version=1.5.0 resolution failure @mbien pasted). Advertising 26/27 in the NetBeans config would just trade the empty-dropdown bug for a worse "server dies at startup with a cryptic OSGi trace" bug.

So I've dropped the 26/27 additions (and the v27 enum constant) and force-pushed. To still close #9423, I reworked the PR to fix the dialog itself: when no installed JDK matches the server's supported range, the panel now shows a message naming the supported range and pointing at Manage Platforms, instead of an empty combo with only Cancel. That fixes the reported UX without misrepresenting GlassFish's JDK support. Once a GlassFish release genuinely boots on 26, bumping the config is a one-liner.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) enterprise [ci] enable enterprise job Java EE/Jakarta EE [ci] enable enterprise job

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IDE can't find jre for Web Server

3 participants