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 9f8e044e48 Add Java 25 support for JSP compilation
9f8e044e48 is described below
commit 9f8e044e48789d47bbf443c89f0edf33cc18b80d
Author: Mark Thomas <[email protected]>
AuthorDate: Fri Mar 28 11:55:31 2025 +0000
Add Java 25 support 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 981e8f7b53..71f6c5b4c6 100644
--- a/java/org/apache/jasper/compiler/JDTCompiler.java
+++ b/java/org/apache/jasper/compiler/JDTCompiler.java
@@ -339,6 +339,11 @@ public class JDTCompiler extends
org.apache.jasper.compiler.Compiler {
// Java 8.
// 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.
+ // This is checked against the actual version below.
+ settings.put(CompilerOptions.OPTION_Source, "25");
} else {
log.warn(Localizer.getMessage("jsp.warning.unknown.sourceVM",
opt));
settings.put(CompilerOptions.OPTION_Source,
CompilerOptions.VERSION_1_8);
@@ -445,6 +450,12 @@ public class JDTCompiler extends
org.apache.jasper.compiler.Compiler {
// This is checked against the actual version below.
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.
+ // This is checked against the actual version below.
+ settings.put(CompilerOptions.OPTION_TargetPlatform, "25");
+ settings.put(CompilerOptions.OPTION_Compliance, "25");
} 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 b8c4fc28c4..0093254f29 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -198,6 +198,13 @@
exploded web applications. The <code>compilerClassName</code> to use is
<code>org.apache.jasper.compiler.JavaCompiler</code>. (remm)
</add>
+ <add>
+ Add support for specifying Java 25 (with the value <code>25</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 used.
+ (markt)
+ </add>
</changelog>
</subsection>
<subsection name="Cluster">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]