Skip to content

Add Java SE 26 and 27 platforms to GlassFish 7.1 and 8.0 server configs#9445

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

Add Java SE 26 and 27 platforms to GlassFish 7.1 and 8.0 server configs#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 NetBeans 30 (which bundles JDK 26), starting a GlassFish server pops up the
"select a Java SE platform" dialog with an empty platform dropdown and only a
Cancel button, so the server cannot be launched.

Root cause

Support for JDK 26 was added in JavaSEPlatform.java (commit a0d2484) by adding
the v26 enum constant, but the corresponding <platform version="26"/> entry was
never added to any GlassFish server config XML. (The earlier "add JDK 24" change,
1e42bf8, correctly updated both the enum and GlassFishV8_0_0.xml; the JDK 25 and
JDK 26 changes updated only the enum.)

As a result, JavaUtils.findSupportedPlatforms(instance) intersects the installed
platforms with the server's supported set ({21..25}) and returns an empty array when
the only registered JDK is 26. JavaSEPlatformPanel.setDescriptorButtons then disables
the OK button and JavaPlatformsComboBox renders empty.

Fix

Add <platform version="26"/> (and, per review, <platform version="27"/>) to the two
current-generation GlassFish configs that already declare JDK 25 support:

  • GlassFishV8_0_0.xml
  • GlassFishV7_1_0.xml

JDK 27 — why the enum constant is also added

A config <platform version="N"/> entry is inert without a matching enum constant:

  • JavaSESet.platforms() converts the config's version strings via
    JavaSEPlatform.toValue(...) and silently drops any string with no enum constant.
  • The installed JDK's spec version is itself resolved through
    JavaSEPlatform.toValue(...) in JavaUtils.findSupportedPlatforms, so an unmatched
    version can never be contains-matched in the supported EnumSet.

So adding version="27" to the XML alone would do nothing. To make 27 real (and to keep
the enum/config in sync — the very asymmetry that caused this bug), this PR also adds the
v27 constant to JavaSEPlatform.

Out of scope

  • Older GlassFishV7_0_* configs cap at lower JDK levels and represent specific past
    releases; bumping them is a compatibility judgement, intentionally left out (per review).
  • The Payara configs are considerably more stale (e.g. PayaraV7.xml lists only
    <platform version="21"/>); a separate, larger gap, not touched here.

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

JDK 26 support was added to JavaSEPlatform (commit a0d2484) by adding the
v26 enum constant, but no GlassFish server config XML declared
<platform version="26"/>. JavaUtils.findSupportedPlatforms() therefore
intersected the installed platforms with the server's supported set ({21..25})
and returned an empty array when the only registered JDK was 26, leaving the
Java SE platform selector with an empty dropdown so the server could not be
started (apache#9423).

Restore enum/config parity by declaring 26 in the two current-generation
configs that already list 25 (GlassFishV8_0_0.xml, GlassFishV7_1_0.xml).

Also add JDK 27 proactively, ahead of its release during the NB 31 lifecycle.
A config entry is inert without a matching enum constant -- JavaSESet filters
out unknown version strings, and the installed JDK's spec version is itself
resolved through JavaSEPlatform.toValue -- so the v27 enum constant is added
alongside the config entries so that 27 is actually recognized when present.

Fixes apache#9423
@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.

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

Labels

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

2 participants