用NETBEANS6.9 做了一个简单的界面程序,
用 exe4j 转换 exe格式的文件,, 按教程一步一步来的
最后,运行时,报错。。。
是什么原因?
谢谢
java.lang.NoClassDefFoundError: org/jdesktop/application/SingleFrameApplication
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
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)
at com.exe4j.runtime.LauncherEngine.launch(Unknown Source)
at com.exe4j.runtime.WinLauncher.main(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.jdesktop.application.SingleFrameApplication
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
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)
... 14 more
------解决方案--------------------
dist目录里,有一个生成的**.jar文件,和lib文件夹,只要你保正jar文件所在的目录里有这个lib文件夹,在哪里运行都没有问题。比如你在c:\aaa目录下,那么c:\aaa\**.jar 和c:\aaa\lib\*都要有才行。