On 17/05/2023 11:58, Holger Klawitter wrote:
Hi there,

I am using tomcat 9.0.73 along with jdk 17.0.7+8.
I have set up tomcat to support jdk 17 on all jsp pages.

     <servlet>
         <servlet-name>jsp</servlet-name>
         <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
         <init-param>
             <param-name>compilerSourceVM</param-name>
             <param-value>17</param-value>
         </init-param>
         <init-param>
             <param-name>compilerTargetVM</param-name>
             <param-value>17</param-value>
         </init-param>
         <init-param>
             <param-name>fork</param-name>
             <param-value>false</param-value>
         </init-param>
         <init-param>
             <param-name>xpoweredBy</param-name>
             <param-value>false</param-value>
         </init-param>
         <load-on-startup>3</load-on-startup>
     </servlet>

In the logfiles I notice the following Warning:

17-May-2023 11:53:37.171 WARNUNG [http-nio-80-exec-10] 
org.apache.jasper.compiler.JDTCompiler.generateClass Unsupported source VM [17] 
requested, using [16]

Does this mean that tomcat/jasper is not fully supporting jdk17 at this point?

No.

Tomcat 9.0.x is required by the Servlet specification to be built for Java 8. Version 4.20 (also know as version 3.26.0) of the Eclipse JDT compiler is the latest version that works with Java 8. It supports up to Java 16.

If you want to use JSPs on Tomcat 9.0.x with a Java version greater than 16 you need to replace $CATALINA_HOME/lib/ecj-4.20.jar with a newer version.

Newer JARs are available from Eclipse or Maven Central:

https://search.maven.org/artifact/org.eclipse.jdt/ecj

Tomcat 10.1.x currently ships with the latest JAR.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to