Jump to content

Producing Java 1.6 jasper files using Java 1.7 in an Ant build


Recommended Posts

I'm trying to produce jasper files which will work when my web start application is run on a user compuer running Java 1.6.  The twist is that my Ant build (running under Hudson) needs to use Java 1.7 for steps other than the jasper reports compiler ("jrc").  For javac I simply add the attributes source="1.6" and target="1.6".  What can I do to have the same effect with jrc?


I have tried using the following properties by setting them in a jasperreports.properties file and placing the file in the working directory of the Ant build.  This seemed to have no effect.





When I attempt to use one of the jasper files as a user I get the following exception:

Exception in thread "AbstractThreadedAction" java.lang.UnsupportedClassVersionError: FormEntryMaster_1371132769401_879595 : Unsupported major.minor version 51.0

at java.lang.ClassLoader.defineClass1(Native Method)

at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)

at java.lang.ClassLoader.defineClass(ClassLoader.java:615)

at net.sf.jasperreports.engine.util.JRClassLoader.loadClass(JRClassLoader.java:338)

at net.sf.jasperreports.engine.util.JRClassLoader.loadClassFromBytes(JRClassLoader.java:239)

at net.sf.jasperreports.engine.design.JRAbstractJavaCompiler.loadEvaluator(JRAbstractJavaCompiler.java:102)

at net.sf.jasperreports.engine.design.JRAbstractCompiler.loadEvaluator(JRAbstractCompiler.java:340)

at net.sf.jasperreports.engine.JasperCompileManager.getEvaluator(JasperCompileManager.java:265)

at net.sf.jasperreports.engine.fill.JRFillDataset.createCalculator(JRFillDataset.java:457)

at net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:382)

at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:88)

at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:103)

at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:61)

at net.sf.jasperreports.engine.fill.JRFiller.createFiller(JRFiller.java:153)

at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:82)

at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:653)

at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:969)

at com.ibl.client.form.FormPrintBuilder.createFormEntry(FormPrintBuilder.java:394)

at com.ibl.client.form.FormPrintBuilder.createPrint(FormPrintBuilder.java:288)

at com.ibl.client.form.FormEntryTablePanel$10.inBackgroundThread(FormEntryTablePanel.java:685)

at com.ibl.client.custom.AbstractThreadedAction$EventProcessor.run(AbstractThreadedAction.java:75)

at com.ibl.client.custom.AbstractThreadedAction$QueueRunner.run(AbstractThreadedAction.java:54)

at java.lang.Thread.run(Thread.java:662)


Using Java 1.6.0_33 (on user computer), Java 1.7.0_21 (for Ant build), JasperReports 5.1.0, Ant 1.9.1, Hudson 1.395.1, 


Thanks for any suggestions!



Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

That was the answer - Thanks!


For others: I placed a plain text file jasperreports.properties with the above property entries into the classpath for the jrc step. I found the JDT compiler jar jdt-compiler-3.1.1.jar in the lib directory of the jasper projects file jasperreports-5.1.2-project.zip. I placed it in the classpath also.



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...