Jump to content
Changes to the Jaspersoft community edition download ×

.jasper java version ?


Recommended Posts

  • 3 weeks later...
  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic



Recompiling the *.jasper file under JDK 1.4 would be a solution.


But you could also make sure that no matter which JDK version you are running on, the jdt-compiler.jar is in the classpath of you application, and then you could control the source and target compatibility of the generated files using some configurations properties, as see in the jasperreports.properties file in the /demo/samples/java1.5 sample provided with the project.


I hope this helps.


Link to comment
Share on other sites

  • 4 years later...

Hi teodor,


Thanks for your prompt suggestion regarding jdt-compiler. I see also that you are the author of the related JR** classes, so you have the best overview on the issue... :)

But, I have similar problems for which I would like your expert opinion.

I had to create a working environment with an older release of our Java product (setup with IntelliJ) which I am not sure which JDK was built against.

I tried to compile all with one of the latest JDK 1.6, which was succesful but at runtime I receive a JRException "Error loading object from file xyz " . where xyz stands for a jasper file, from JRLoader -> loadObject().

I tried with jdt compiler and picked the one shipped with jasper reports engine, jdt-compiler-3.1.1.jar.

By the time i put it in my classpath, it took over, of course, and tried to compile my jrxml files.

Now, the issue is that am getting errors like:

"The operator - is undefined for the argument type(s) java.lang.Integer, java.lang.Integer" or

"Cannot cast from long to Long" or "The constructor Date(Long) is undefined".

To me it looks like after the jdt compiler is in classpath, somehow there is a behavior like using compiler of a previous JDK version , where some constcructors, auto-boxing and unboxing was not yet implemented.

So, the question is, is there an issue with JRLoader when trying to load files, perhaps built with previous JDK version?

Alternatively, is there an issue with jdt compiler that makes it work like an older version compiler , not recognizing newest implementations?

Please tell me what you think. Thanks in advance.


Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...