This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push:
new 164ce0ca83 Add Java 27 support (where supported by JDT) for JSP
compilation
164ce0ca83 is described below
commit 164ce0ca832a1da4b819c57d28b92ba55e1a95cc
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 8ebb265e73..e92c0737d0 100644
--- a/java/org/apache/jasper/compiler/JDTCompiler.java
+++ b/java/org/apache/jasper/compiler/JDTCompiler.java
@@ -358,10 +358,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 8.
// 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_1_8);
@@ -469,11 +479,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 8.
// 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_1_8);
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 9a388bcf64..9d0787a416 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -213,6 +213,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]