Jump to content
Changes to the Jaspersoft community edition download ×

Error compiling .jrxml file at run time ?

Recommended Posts

By: tfindlay - exie

Error compiling .jrxml file at run time ?

2006-04-27 22:27



I've started my first JasperReports project, and am using IBM Rational Application Developer (because I'm not a "REAL" programmer).


I've got my project working, and added the following JAR's:













I then created a class with the following code:


public void execute(String id) throws Exception


JasperReport jasperReport;

JasperPrint jasperPrint;





JRTextExporter exporter = new JRTextExporter();


jasperReport = JasperCompileManager.compileReport("/projects/rsa_PRJ276/orrExtractWeb/WebContent/reports/vwa_test1.jrxml");

jasperPrint = JasperFillManager.fillReport(jasperReport, new HashMap(), new JREmptyDataSource());




But when it executes, it always crashes when I try to compile the report ...


[28/04/06 15:17:20:453 EST] 110e110e SystemErr R net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:

C:Program FilesIBMRationalSDP6.0Simple_Report_1146201435765_227164.java:4: package net.sf.jasperreports.engine does not exist

import net.sf.jasperreports.engine.*;


Using the "J2EE Perspective", I can see the net.sf.jasperreports.engine classes there.


It seems lots of other people have posted this question, but I couldnt find any clear answers sorry. Any hints/tips would be great.





By: PJ Alarcon - pjalarcon

RE: Error compiling .jrxml file at run time ?

2006-04-28 00:23

I encountered the same error before. You need to set the System property jasper.reports.compile.class.path:


System.setProperty("jasper.reports.compile.class.path", "full path to jasperreport jar file");





By: Lucian Chirita - lucianc

RE: Error compiling .jrxml file at run time ?

2006-04-28 01:38



The simplest way to fix this is to include the jdt-compiler jar (found in the lib directory of the JR distribution) in the classpath.








By: tfindlay - exie

RE: Error compiling .jrxml file at run time ?

2006-04-29 21:43

Thanks! That worked like a charm. I've now made my first jasper report. :)


I'm now going to try making a fixed-width flat file with it.


Thanks a ton!

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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