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
commit e477e441ffad77948133cea6a679d4323f385a70 Author: Mark Thomas <ma...@apache.org> AuthorDate: Wed Jun 26 14:40:29 2024 +0100 Add Java 24 support --- 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 c1bbb3c44a..1ed4ef4684 100644 --- a/java/org/apache/jasper/compiler/JDTCompiler.java +++ b/java/org/apache/jasper/compiler/JDTCompiler.java @@ -343,6 +343,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, "23"); + } else if (opt.equals("24")) { + // 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, "24"); } else { log.warn(Localizer.getMessage("jsp.warning.unknown.sourceVM", opt)); settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_8); @@ -443,6 +448,12 @@ public class JDTCompiler extends org.apache.jasper.compiler.Compiler { // This is checked against the actual version below. settings.put(CompilerOptions.OPTION_TargetPlatform, "23"); settings.put(CompilerOptions.OPTION_Compliance, "23"); + } else if (opt.equals("24")) { + // 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, "24"); + settings.put(CompilerOptions.OPTION_Compliance, "24"); } 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 931d9ea576..51aac40d50 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -156,6 +156,13 @@ <code>ELException</code> when an object is coerced to a String using <code>ExpressionFactory.coerceToType()</code>. (markt) </fix> + <add> + Add support for specifying Java 24 (with the value <code>24</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="Other"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org