0
6.3.1簡単なレポートのEclipseからのJasperReportsを実行しようとすると:実行することができませんJasperReportsを:ClassNotFoundExceptionが
Apr 11, 2017 1:59:41 PM net.sf.jasperreports.extensions.DefaultExtensionsRegistry loadRegistries
WARNING: Extension resource jar:file:/C:/Portable%20Programs/eclipse/packages/jasperreports/dist/jasperreports-javaflow-6.3.1.jar!/jasperreports_extension.properties was found to be a duplicate of jar:file:/C:/Portable%20Programs/eclipse/packages/jasperreports/dist/jasperreports-6.3.1.jar!/jasperreports_extension.properties in classloader [email protected]
Start
Exception in thread "main" java.lang.NoClassDefFoundError: com/lowagie/text/DocumentException
at net.sf.jasperreports.engine.JasperExportManager.exportToPdfFile(JasperExportManager.java:150)
at net.sf.jasperreports.engine.JasperExportManager.exportReportToPdfFile(JasperExportManager.java:503)
at test.jaspertest.JasperTest.main(JasperTest.java:24)
Caused by: java.lang.ClassNotFoundException: com.lowagie.text.DocumentException
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 3 more
Javaバージョン1.8.0.121:
package test.jaspertest;
import java.util.HashMap;
import net.sf.jasperreports.engine.JasperReport;
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;
public class JasperTest {
public static void main(String[] args) {
System.out.println("Start");
try {
JasperReport jasperReport = JasperCompileManager.compileReport("reports/simple.xml");
JasperPrint jasperPrint = JasperFillManager.fillReport(
jasperReport,
new HashMap(),
new JREmptyDataSource());
JasperExportManager.exportReportToPdfFile(jasperPrint, "reports/simple.pdf");
} catch (JRException e) {
e.printStackTrace();
}
}
}
は、このうちのメッセージを持っています。私はJavaにあまり慣れていないので、誰でもこの問題を助けてくれますか?前もって感謝します!