MaintainJ Blog

April 15, 2018

MaintainJ.war with Tomcat 6 and JDK 1.8

Filed under: Uncategorized — maintainj @ 7:37 pm

One of the users recently came with a problem with Tomcat 6 and JDK 1.8. I am able to start the Tomcat with this version of JDK, but when I deploy MaintainJ.war, I was getting the below exception when tomcat tries to compile the JSPs in MaintainJ.war.

org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException at
org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader.<init>(ClassFileReader.java:372) at
org.apache.jasper.compiler.JDTCompiler$1.findType(JDTCompiler.java:232)

I got a clue from this Stackoverflow post to fix this issue. I downloaded Tomcat 8 zip and took the lib/ecj-4.6.3.jar from that zip and placed it under tomcat6/lib folder. I also had to remove tomcat6/lib/jasper-jdt.jar . Once I did this change, everything worked as expected with MaintainJ.war. Basically the tomcat compiler seems to need a more recent jar to work with JDK 1.8.

Choudary.

Powered by WordPress