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 eb1a3629ab Add Java 25 support for JSP compilation
eb1a3629ab is described below
commit eb1a3629abdab908274bfeaedaab29dc704d9de9
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 4180034073..181367afe2 100644
--- a/java/org/apache/jasper/compiler/JDTCompiler.java
+++ b/java/org/apache/jasper/compiler/JDTCompiler.java
@@ -330,6 +330,11 @@ public class JDTCompiler extends
org.apache.jasper.compiler.Compiler {
// Java 11.
// 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_11);
@@ -427,6 +432,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_11);
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index ac5fe7ce7a..ef3547d5bd 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -202,6 +202,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]