From 802f0a044db44d82351c22a37fd0d0d023e6e463 Mon Sep 17 00:00:00 2001 From: Michael Bien Date: Thu, 16 Jul 2026 16:44:44 +0200 Subject: [PATCH] Permit running Payara on JDK 25 --- .../nbproject/project.properties | 2 +- .../tooling/server/config/JavaSEPlatform.java | 38 ++++++++++--------- .../payara/tooling/server/config/PayaraV6.xml | 4 ++ .../payara/tooling/server/config/PayaraV7.xml | 7 ++++ 4 files changed, 32 insertions(+), 19 deletions(-) diff --git a/enterprise/payara.tooling/nbproject/project.properties b/enterprise/payara.tooling/nbproject/project.properties index 0f4ec98bc91a..0d2669d99ce7 100644 --- a/enterprise/payara.tooling/nbproject/project.properties +++ b/enterprise/payara.tooling/nbproject/project.properties @@ -14,5 +14,5 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -javac.source=1.8 +javac.release=21 javac.compilerargs=-Xlint -Xlint:-serial diff --git a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/JavaSEPlatform.java b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/JavaSEPlatform.java index 67d45035594b..bad93c1fcb12 100644 --- a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/JavaSEPlatform.java +++ b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/JavaSEPlatform.java @@ -50,7 +50,9 @@ public enum JavaSEPlatform { /** JavaSE 17. */ v17, /** JavaSE 21. */ - v21; + v21, + /** JavaSE 25. */ + v25; // Class attributes // /** Payara JavaEE platform enumeration length. */ @@ -92,6 +94,9 @@ public enum JavaSEPlatform { /** A String representation of v21 value. */ static final String V21_STR = "21"; + /** A String representation of v25 value. */ + static final String V25_STR = "25"; + /** * Stored String values for backward String * conversion. @@ -136,22 +141,19 @@ public static JavaSEPlatform toValue(final String platformName) { */ @Override public String toString() { - switch (this) { - case v1_1: return V1_1_STR; - case v1_2: return V1_2_STR; - case v1_3: return V1_3_STR; - case v1_4: return V1_4_STR; - case v1_5: return V1_5_STR; - case v1_6: return V1_6_STR; - case v1_7: return V1_7_STR; - case v1_8: return V1_8_STR; - case v11: return V11_STR; - case v17: return V17_STR; - case v21: return V21_STR; - // This is unrecheable. Being here means this class does not handle - // all possible values correctly. - default: throw new ServerConfigException( - ServerConfigException.INVALID_SE_PLATFORM_VERSION); - } + return switch (this) { + case v1_1 -> V1_1_STR; + case v1_2 -> V1_2_STR; + case v1_3 -> V1_3_STR; + case v1_4 -> V1_4_STR; + case v1_5 -> V1_5_STR; + case v1_6 -> V1_6_STR; + case v1_7 -> V1_7_STR; + case v1_8 -> V1_8_STR; + case v11 -> V11_STR; + case v17 -> V17_STR; + case v21 -> V21_STR; + case v25 -> V25_STR; + }; } } diff --git a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/PayaraV6.xml b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/PayaraV6.xml index a8318a94eee3..8fe84c63b8c4 100644 --- a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/PayaraV6.xml +++ b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/PayaraV6.xml @@ -35,6 +35,10 @@ under the License. + + + + diff --git a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/PayaraV7.xml b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/PayaraV7.xml index b003efb894ed..3090800f1be6 100644 --- a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/PayaraV7.xml +++ b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/PayaraV7.xml @@ -25,6 +25,13 @@ under the License. + + + + + + +