Skip to content

Instantly share code, notes, and snippets.

@huxendupsel
huxendupsel / jasperreports_javac.md
Last active December 1, 2016 11:27
jasperreport compile report over jre leads to exception

Jasperreport compile report over JRE leads to exception

to compile a report via

JasperCompileManager.compileReportToStream(design, os);

you have to provide some kind of compile mechanism. On default the javac of the jdk is used to compile the jrxml to jasper file. So if you're not using jdk but jre instead the code will not work. It will produce exceptions like this:

net.sf.jasperreports.engine.JRException: Error compiling report java source files :C:\Workspace\ABOVU-Client\file_1479896387177_924178.java 
	at net.sf.jasperreports.engine.design.JRJavacCompiler.compileClasses(JRJavacCompiler.java:106)
	at net.sf.jasperreports.engine.design.JRAbstractClassCompiler.compileUnits(JRAbstractClassCompiler.java:77)