代码如下
public class TestReportEngine {
private static EngineConfig config;
public static final String BIRT_HOME = "D:/work/birt-runtime-4_2_2/ReportEngine";
public static void main(String[] args) {
try {
config = new EngineConfig();
config.setEngineHome(BIRT_HOME);
Platform.startup(config);
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
Platform.startup(config) 抛出的异常代码
Exception in thread "main" java.lang.NoClassDefFoundError: com/ibm/icu/util/UResourceBundle
at org.eclipse.birt.core.framework.osgi.OSGILauncher.doStartup(OSGILauncher.java:123)
at org.eclipse.birt.core.framework.osgi.OSGILauncher.access$0(OSGILauncher.java:94)
at org.eclipse.birt.core.framework.osgi.OSGILauncher$1.run(OSGILauncher.java:79)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.birt.core.framework.osgi.OSGILauncher.startup(OSGILauncher.java:75)
at org.eclipse.birt.core.framework.Platform.startup(Platform.java:80)
at TestReportEngine.main(TestReportEngine.java:17)
Caused by: java.lang.ClassNotFoundException: com.ibm.icu.util.UResourceBundle
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:303)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316)
... 7 more
------解决思路----------------------
NoClassDefFoundError 找不到 com/ibm/icu/util/UResourceBundle
检查下,jar有无添加进去