effingen Posted October 28, 2014 Share Posted October 28, 2014 I can't compile tempaltes with JRJdtCompiler because jdtcore:3.1.0 does not support java 8.Caused by: net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:1. The type java.lang.CharSequence cannot be resolved. It is indirectly referenced from required .class files[/code]I can't use JRJdk13Compiler, cause it can't compile templates which use functions. symbol: method DATEFORMAT(Date,String) location: class report_1414506137290_237400/Users/Mariusz/Work/coresuite-cloud/dataCloud/report_1414506137290_237400.java:255: error: cannot find symbol value = DATEFORMAT(((...[/code]I know Java 8 is not yet supported, but is there some workaround? If not, is there some ETA? I wouldn't like to implement my own JRCompiler. Link to comment Share on other sites More sharing options...
Solution effingen Posted October 31, 2014 Author Solution Share Posted October 31, 2014 I tried simple update of eclipse jdt lirbary and it seems to be working. <dependency> <groupId>net.sf.jasperreports</groupId> <artifactId>jasperreports</artifactId> <version>5.6.1</version> <exclusions> <exclusion> <groupId>eclipse</groupId> <artifactId>jdtcore</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.eclipse.jdt.core.compiler</groupId> <artifactId>ecj</artifactId> <version>4.4</version> </dependency>[/code] Link to comment Share on other sites More sharing options...
msescott Posted November 21, 2014 Share Posted November 21, 2014 I'm getting the same problem with JDK8 and I'm trying to get your workaround going without success. Can you enumerate the step by step process you took, eg. what files you modified and what were the locations of these files. Link to comment Share on other sites More sharing options...
effingen Posted November 24, 2014 Author Share Posted November 24, 2014 This is the only change I did. It was made in our main pom.xml file. We are using Maven. Link to comment Share on other sites More sharing options...
msescott Posted November 24, 2014 Share Posted November 24, 2014 Here's what I did: - I downloaded ecj-4.4.1.jar for the JDT core compiler - I pointed my project's class path to include that jar and removed any reference to any other JDT core jar - (I looked into jasper 5.6.1 but the jar file didn't have any pom.xml file so it must configure things differently, so I stayed with jasper 3.7.1.1) - I got into jasperreports-3.7.1.1.jar then META-INFmavenjasperreportsjasperreports and edited the pom.xml within that folder with the following changes: net.sf.jasperreports jasperreports 3.7.1.1 eclipse jdtcore eclipse ecj 4.4.1 compile - even after I rebuild and restart my project, I keep getting the following When my Java code calls: JasperCompileManager.compileReportToFile(JasperDesign p1, String p2); org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException at org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader.(ClassFileReader.java:329) Link to comment Share on other sites More sharing options...
effingen Posted November 25, 2014 Author Share Posted November 25, 2014 It seems that you include Jasper library differently than I do. In my case Maven is doing all dependency resolving, and that is why I need to have pom.xml in the root directory of my project. Are you using Maven? Or did you just downloaded Jasper and included it in your lib directly? Link to comment Share on other sites More sharing options...
msescott Posted November 25, 2014 Share Posted November 25, 2014 The latter. Until now we have simply been using 2 jar files among all of our other jars in a lib folder. One is the Jasper Reports JAR and the other is a jar with the JDT core code. Prior to JDK8, everything worked by itself when loading/compiling Jasper jrxml files on the fly from Java code. Link to comment Share on other sites More sharing options...
effingen Posted November 25, 2014 Author Share Posted November 25, 2014 It should be enough to update the ecj library then. Maybe try one version higher than the one which comes with Jasper. Link to comment Share on other sites More sharing options...
msescott Posted November 25, 2014 Share Posted November 25, 2014 I have tried ecj-4.4.1.jar and jave also tried the old jdtcore 3.1.1 version. Doesn't seem like any combination works. Link to comment Share on other sites More sharing options...
slavaz Posted February 5, 2016 Share Posted February 5, 2016 Thanks to effingen and having made changes to plugin as advised I was able to compile reports with Java 8. Sorry, can not figure out how to format it nicely, anyway here it is org.codehaus.mojo jasperreports-maven-plugin 1.0-beta-2 ${project.basedir}/src/main/webapp/templates/ ${project.basedir}/src/main/webapp/templates/ compile compile-reports net.sf.jasperreports jasperreports 4.7.0 eclipse jdtcore org.eclipse.jdt.core.compiler ecj 4.4.2 org.codehaus.groovy groovy-all 1.7.5 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now