This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 11.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/11.0.x by this push:
     new a66a82baa9 Add Java 27 support (where supported by JDT) for JSP 
compilation
a66a82baa9 is described below

commit a66a82baa944da2d818ae9ca0bf9cbbbd7486c9a
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 | 11 +++++++++++
 webapps/docs/changelog.xml                       |  7 +++++++
 2 files changed, 18 insertions(+)

diff --git a/java/org/apache/jasper/compiler/JDTCompiler.java 
b/java/org/apache/jasper/compiler/JDTCompiler.java
index f76b87ae9f..75888a6150 100644
--- a/java/org/apache/jasper/compiler/JDTCompiler.java
+++ b/java/org/apache/jasper/compiler/JDTCompiler.java
@@ -340,6 +340,11 @@ public class JDTCompiler extends 
org.apache.jasper.compiler.Compiler {
                 // Tomcat. 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 shipped with
+                // Tomcat. 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_17);
@@ -431,6 +436,12 @@ public class JDTCompiler extends 
org.apache.jasper.compiler.Compiler {
                 // 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 shipped with
+                // Tomcat. 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_17);
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 93924b3b72..9650bdada8 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]

Reply via email to