This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push:
new d824df2115 Add Java 27 support (where supported by JDT) for JSP
compilation
d824df2115 is described below
commit d824df21154908079b87c9aa828f543fb3391e67
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 | 12 ++++++++++++
webapps/docs/changelog.xml | 7 +++++++
2 files changed, 19 insertions(+)
diff --git a/java/org/apache/jasper/compiler/JDTCompiler.java
b/java/org/apache/jasper/compiler/JDTCompiler.java
index 85d2708958..c894275905 100644
--- a/java/org/apache/jasper/compiler/JDTCompiler.java
+++ b/java/org/apache/jasper/compiler/JDTCompiler.java
@@ -316,6 +316,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");
+ case "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");
default -> {
log.warn(Localizer.getMessage("jsp.warning.unknown.sourceVM", opt));
settings.put(CompilerOptions.OPTION_Source,
CompilerOptions.VERSION_21);
@@ -427,6 +432,13 @@ public class JDTCompiler extends
org.apache.jasper.compiler.Compiler {
settings.put(CompilerOptions.OPTION_TargetPlatform, "26");
settings.put(CompilerOptions.OPTION_Compliance, "26");
}
+ case "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");
+ }
default -> {
log.warn(Localizer.getMessage("jsp.warning.unknown.targetVM", opt));
settings.put(CompilerOptions.OPTION_TargetPlatform,
CompilerOptions.VERSION_21);
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 537513e773..e777ceab81 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -337,6 +337,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]