• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
  • Piet Souris
  • Himai Minh

Making Jasper Reports works.

Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am new to Jasper reports. I copy a sample code on how to use jasper reports using Netbeans 5.5. Following the procedure and compile the application, and like magic, series of errors appear. Can you help me guys in solving this.

Here is the code (very simple and yet have errors):

----Start after this line----

<?xml version="1.0"?>
<!DOCTYPE jasperReport
PUBLIC "-//JasperReports//DTD Report Design//EN"

<jasperReport name="HelloReportWorld">
<band height="20">
<reportElement x="180" y="0" width="200" height="20"/>
<text><![CDATA[Hello World!]]></text>

------- end here ---------


----Start after this line----

package reportapps;

import java.util.HashMap;
import net.sf.jasperreports.engine.JREmptyDataSource;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperCompileManager;
import net.sf.jasperreports.engine.JasperExportManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.JasperReport;

* @author shalimar
public class Main {

/** Creates a new instance of Main */
public Main() {

* @param args the command line arguments
public static void main(String[] args) {
JasperReport jasperReport;
JasperPrint jasperPrint;
try {
jasperReport = JasperCompileManager.compileReport( "report/templates/HelloReportWorld.jrxml");
jasperPrint = JasperFillManager.fillReport(jasperReport, new HashMap(), new JREmptyDataSource());
JasperExportManager.exportReportToHtmlFile( jasperPrint, "report/results/simple_report.pdf");
} catch (JRException e) {


------END HERE------------


----Start after this line----

net.sf.jasperreports.engine.JRException: Error compiling report java source files : /home/shalimar/ReportApps/HelloReportWorld_1171871987558_150188.java
at net.sf.jasperreports.engine.design.JRJavacCompiler.compileClasses(JRJavacCompiler.java:93)
at net.sf.jasperreports.engine.design.JRAbstractClassCompiler.compileUnits(JRAbstractClassCompiler.java:67)
at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:190)
at net.sf.jasperreports.engine.design.JRDefaultCompiler.compileReport(JRDefaultCompiler.java:105)
at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:211)
at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:144)
at reportapps.Main.main(Main.java:38)
Caused by: java.io.IOException: java.io.IOException: javac: not found
at java.lang.UNIXProcess.<init>(UNIXProcess.java:148)
at java.lang.ProcessImpl.start(ProcessImpl.java:65)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:451)
at java.lang.Runtime.exec(Runtime.java:591)
at java.lang.Runtime.exec(Runtime.java:464)
at net.sf.jasperreports.engine.design.JRJavacCompiler.compileClasses(JRJavacCompiler.java:62)
... 6 more

------END HERE----------

Can you help me in this?


Java Cowboy
Posts: 16084
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I had a quick look at the error messages and this line looks important:

Caused by: java.io.IOException: java.io.IOException: javac: not found

It looks like the software you're trying to use cannot find the Java compiler. You probably have to configure it to tell it where to find the Java compiler.

It might be a good idea to ask your questions in the forums on the JasperReports website - there will undoubtedly be more people with experience with JasperReports there.
Anderson gave himself the promotion. So I gave myself this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
    Bookmark Topic Watch Topic
  • New Topic