import net.sf.jasperreports.engine.*;
import net.sf.jasperreports.engine.export.*;
import net.sf.jasperreports.engine.util.*;
import net.sf.jasperreports.view.*;
import java.util.*;
import java.sql.*;
import java.io.*;
import java.awt.*;
public class MyReport {
public static void main(String[] args) {
String fileName = "o.jrxml";
try
{
JasperCompileManager.compileReportToFile(fileName);
System.err.println("C");
}
catch (JRException e)
{
e.printStackTrace();
System.exit(1);
}
}
}
编译没有问题,可是一运行就报如下错误
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/di
gester/Digester
at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(
JasperCompileManager.java:82)
at MyReport.main(MyReport.java:17)
------解决方法--------------------------------------------------------
看错误提示也可以知道是缺少那个apache的lib造成的出错啊?
------解决方法--------------------------------------------------------
http://apache.linuxforum.net/dist/jakarta/commons/
commmons-digester-current.zip
commons-beanutils-1.7.0.zip
commons-logging-current.zip
itext-1.1.jar