Jesper de Jong wrote:That's not true, I'm using Tomcat 8 on Java 8 without problems. Why do you think Tomcat 8 does not work on Java 8?
From the Tomcat 8.0.15 Release Notes:
Tomcat 8.0.15 Release Notes wrote:
Tomcat 8.0 is designed to run on Java SE 7 and later.
It does not when it comes to
JSP pages. Try to use closures in a JSP page
The exception will follow as bellow.
type Exception report
message Unable to compile class for JSP:
description The server encountered an internal error that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 131 in the jsp file: /inventory.jsp
Lambda expressions are allowed only at source level 1.8 or above
128: }
129:
130:
131: Collections.sort(selectedLines, (String o1, String o2)->f.parse(o1.split(",")[0]).compareTo(f.parse(o2.split(",")[0])));
132:
133: //Collections.sort(selectedLines, new StringDateComparator());
134: DateFormat formatterCsv1 = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss SSS");
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:103)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:199)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:450)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:361)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:336)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:323)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
note The full stack trace of the root cause is available in the Apache Tomcat/8.0.15 logs.