0

I have created a simple .jar with a class to process a parameter in my Jasper report via scriptlets. I have added the .jar to the build path of the report project.

The .jar has been compiled with JDK 1.7, and the execution enviroment of the Jasper project is set to JRE 1.7, and also the Java Compiler compliance level is 1.7. JAVA_HOME points to jdk 1.7.

Still JasperStudio complains of Unsupported major.minor version 51.0 when trying to access the .jar throught the scriptlet parameter.

Is JasperStudio using jdk 1.6 ?! I think I have ensured it does not by setting all relevant Java properties for the project.

My computer does not even have java 1.6.

There is sth about JasperStudio evidently that still is overriding my jre/jdk choices, but I do not know where/how. Please send me your suggestions on where to look. Thanks a millio

1 Answers1

0

This exception occurs when compiled class version (JDK) does not match with the executing class version (JDK). Jasperserver has a inbuilt JRE within it. Please confirm the jasperserver JDK Version with the Installed JDK version (Oracle).

To fix the actual problem you should try to either run the Java code with a newer version of Java JRE or specify the target parameter to the Java compiler to instruct the compiler to create code compatible with earlier Java versions.

For example, in order to generate class files compatible with Java 1.4, use the following command line:

javac -target 1.4 HelloWorld.java

Here 1.4 refers to the JDK version of Jasper Server.