Search code examples
javajasper-reportsjava-11

Java 11 Jasper report compilation error: org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException


Getting following error when jasper report compile in Java 11:

ERROR [net.sf.jasperreports.engine.design.JRJdtCompiler] (default task-94) Compilation error: org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException [Server:app-node-00] at deployment.app.ear//org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader.(ClassFileReader.java:329) [Server:app-node-00] at deployment.app.ear//net.sf.jasperreports.engine.design.JRJdtCompiler$1.findType(JRJdtCompiler.java:251) [Server:app-node-00] at deployment.app.ear//net.sf.jasperreports.engine.design.JRJdtCompiler$1.findType(JRJdtCompiler.java:187) [Server:app-node-00] at deployment.app.ear//org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:97)

We are using jasperreports-javaflow-6.5.1.jar.


Solution

  • org.tolven.library.jboss-rules.core-3.2.3.v_686_R32x.jar, assuming that it's the same file as the one here, seems to be a very old (released in 2007) JDT compiler implementation that's not able to read classes compiled for Java 11.

    For Java 11 you'll need a more recent JDT version, for instance 4.4.2. But then there's a risk that the code that depends on the 3.2.3 JDT implementation no longer works with the more recent JDT version, in which case I don't know what you can do.

    You might also need to upgrade the JasperReports version, according to the change log support for Java 11 has been introduced in 6.8.0.