(Filing an already fixed issue, for better tracking). Add support for Java 8 for JSP compilation in Tomcat. Allow to use "1.8" as the value for compilerSourceVM, compilerTargetVM options of JspServlet. Implementing this feature means that Eclipse JDT compiler bundled with Tomcat have to be updated to a later version (beyond the 4.3.1 that we are using today). From [1]: [quote] Eclipse support for Java™ 8: Starting with I20140318-0830 all our Luna (4.4) builds contain the Eclipse support for Java™ 8. For Kepler SR2 (4.3.2) a feature patch is available (P20140317-1600). [/quote] As of now, the latest builds of Eclipse are [1]: 1) 4.3.2 - 21 Feb 2014 2) 4.4M6 - 6 March 2014 3) I20140318-0830 - 18 Mar 2014 ("I": an integration build) 4) N20140318-2000 - 18 Mar 2014 ("N": a nightly build) 5) P20140317-1600 - 17 Mar 2014 (Patch build for 4.3.2) -> [2] [2] "Eclipse 4.3.2 Patch Build: P20140317-1600" Explains what this patch build is, and provides download links. [3] JDT/Eclipse Java 8 Support For Kepler (A wiki page). I think it s bit unfortunate that the build number is "P20140317-1600", without any explicit mention of "4.3" branch in the number, but that is how they did it. [1] http://download.eclipse.org/eclipse/downloads/ [2] http://download.eclipse.org/eclipse/downloads/drops4/P20140317-1600/ [3] https://wiki.eclipse.org/JDT/Eclipse_Java_8_Support_For_Kepler
This was implemented in Tomcat 8 by r1579174 and Tomcat 7 by r1579176 and will be in 8.0.4, 7.0.53. Proposed for Tomcat 6.
Note 1. Technically CompilerOptions.VERSION_1_8 is a String constant "1.8", so it will be inlined at compile time. At runtime Tomcat/Jasper will be compatible with any other version of ECJ 4.3.x, e.g. 4.3.1. Note 2. All 547 classes in ecj-P20140317-1600.jar have format version 50.0 (Java 1.6). As such, this jar cannot be used to build Tomcat 6. For historical record, I applied the change to Tomcat 6 in r1584800 but had to revert it right away in r1584806.
Created attachment 31476 [details] 2014-04-04_56283_tc6_v2.patch Patch for Tomcat 6: Add support for running Tomcat 6 with ecj-P20140317-1600.jar (as drop-in replacement for ecj-4.3.1.jar). Add support for value "1.8" for the compilerSourceVM and compilerTargetVM options. Note that, per previous comments, ecj-P20140317-1600.jar can only be used when running with Java 6 or later. The "1.8" options make sense only when running with Java 8 (or later).
Patch applied to 6.0.x for 6.0.40 onwards.
Created attachment 31624 [details] Failing JSP (doesn't compile with a Java 8 JDK and source/target version 1.6) The version of ECJ supplied with 7.0.53 fails to compile JSP files that reference class files containing default methods under the following conditions: - compilerSourceVersion/compilerTargetVersion < 1.8 - JRE_HOME >= jdk1.8.0 Attachment has a minimal test case It looks like it might be Eclipse bug 390889 which is fixed in 4.4M7 https://bugs.eclipse.org/bugs/show_bug.cgi?id=390889
Verified fixed when replacing ecj-P20140317-1600.jar with ecj-4.4M7.jar from http://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops4/S-4.4M7-201405010200/ecj-4.4M7.jar
(In reply to Robbie Gibson from comment #6) > Verified fixed when replacing ecj-P20140317-1600.jar with ecj-4.4M7.jar from > http://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops4/ > S-4.4M7-201405010200/ecj-4.4M7.jar This is a separate issue and should be in a separate bugzilla entry.
Done, sorry for the confusion.
for reference bug 56543
*** Bug 56613 has been marked as a duplicate of this bug. ***