This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push:
new 92616537a2 Add Java 27 support (where supported by JDT) for JSP
compilation
92616537a2 is described below
commit 92616537a26a4212727d7737ddcee278e007fe09
Author: Mark Thomas <[email protected]>
AuthorDate: Wed Mar 11 17:16:07 2026 +0000
Add Java 27 support (where supported by JDT) for JSP compilation
---
java/org/apache/jasper/compiler/JDTCompiler.java | 30 ++++++++++++++++++++----
webapps/docs/changelog.xml | 7 ++++++
2 files changed, 33 insertions(+), 4 deletions(-)
diff --git a/java/org/apache/jasper/compiler/JDTCompiler.java
b/java/org/apache/jasper/compiler/JDTCompiler.java
index 25160d660b..d738b7f482 100644
--- a/java/org/apache/jasper/compiler/JDTCompiler.java
+++ b/java/org/apache/jasper/compiler/JDTCompiler.java
@@ -349,10 +349,20 @@ public class JDTCompiler extends
org.apache.jasper.compiler.Compiler {
// This is checked against the actual version below.
settings.put(CompilerOptions.OPTION_Source, "24");
} else if (opt.equals("25")) {
- // Constant not available in latest ECJ version shipped with
- // Tomcat. May be supported in a snapshot build.
+ // Constant not available in latest ECJ version that runs on
+ // Java 11.
// This is checked against the actual version below.
settings.put(CompilerOptions.OPTION_Source, "25");
+ } else if (opt.equals("26")) {
+ // Constant not available in latest ECJ version.
+ // May be supported in a snapshot build.
+ // This is checked against the actual version below.
+ settings.put(CompilerOptions.OPTION_Source, "26");
+ } else if (opt.equals("27")) {
+ // Constant not available in latest ECJ version.
+ // May be supported in a snapshot build.
+ // This is checked against the actual version below.
+ settings.put(CompilerOptions.OPTION_Source, "27");
} else {
log.warn(Localizer.getMessage("jsp.warning.unknown.sourceVM",
opt));
settings.put(CompilerOptions.OPTION_Source,
CompilerOptions.VERSION_11);
@@ -451,11 +461,23 @@ public class JDTCompiler extends
org.apache.jasper.compiler.Compiler {
settings.put(CompilerOptions.OPTION_TargetPlatform, "24");
settings.put(CompilerOptions.OPTION_Compliance, "24");
} else if (opt.equals("25")) {
- // Constant not available in latest ECJ version shipped with
- // Tomcat. May be supported in a snapshot build.
+ // Constant not available in latest ECJ version that runs on
+ // Java 11.
// This is checked against the actual version below.
settings.put(CompilerOptions.OPTION_TargetPlatform, "25");
settings.put(CompilerOptions.OPTION_Compliance, "25");
+ } else if (opt.equals("26")) {
+ // Constant not available in latest ECJ version.
+ // May be supported in a snapshot build.
+ // This is checked against the actual version below.
+ settings.put(CompilerOptions.OPTION_TargetPlatform, "26");
+ settings.put(CompilerOptions.OPTION_Compliance, "26");
+ } else if (opt.equals("27")) {
+ // Constant not available in latest ECJ version.
+ // May be supported in a snapshot build.
+ // This is checked against the actual version below.
+ settings.put(CompilerOptions.OPTION_TargetPlatform, "27");
+ settings.put(CompilerOptions.OPTION_Compliance, "27");
} else {
log.warn(Localizer.getMessage("jsp.warning.unknown.targetVM",
opt));
settings.put(CompilerOptions.OPTION_TargetPlatform,
CompilerOptions.VERSION_11);
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 5958b1bc29..7823e10d93 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -209,6 +209,13 @@
exception in AstValue. Based on <pr>950</pr> submitted by Jérôme
Besnard. (remm)
</fix>
+ <add>
+ Add support for specifying Java 27 (with the value <code>27</code>) as
+ the compiler source and/or compiler target for JSP compilation. If used
+ with an Eclipse JDT compiler version that does not support these
values,
+ a warning will be logged and the default will be used.
+ (markt)
+ </add>
</changelog>
</subsection>
<subsection name="Cluster">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]