执行java应用程序时launch4j出错

时间:2013-01-06 08:07:58

标签: java mysql database jdbc launch4j

我创建了一个成功创建的Java应用程序的exe文件。但是当我尝试执行它并在显示的表单中放置一些值时,按提交按钮,它显示错误:

Executing: C:\Users\bhawna\Desktop\tto1.exe
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver   at java.net.URLClassLoader$1.run(Unknown Source)    at
     

java.net.URLClassLoader $ 1.run(未知来源)at   java.security.AccessController.doPrivileged(Native Method)at   java.net.URLClassLoader.findClass(未知来源)at   java.lang.ClassLoader.loadClass(未知来源)at   sun.misc.Launcher $ AppClassLoader.loadClass(未知来源)at   java.lang.ClassLoader.loadClass(未知来源)at   java.lang.Class.forName0(Native Method)at   java.lang.Class.forName(未知来源)at   ngo_interface.eventdetail.jButton1ActionPerformed(eventdetail.java:192)     在ngo_interface.eventdetail.access $ 300(eventdetail.java:20)at   ngo_interface.eventdetail $ 4.actionPerformed(eventdetail.java:89)at   javax.swing.AbstractButton.fireActionPerformed(未知来源)at   javax.swing.AbstractButton $ Handler.actionPerformed(Unknown Source)at   javax.swing.DefaultButtonModel.fireActionPerformed(未知来源)at   javax.swing.DefaultButtonModel.setPressed(未知来源)at   javax.swing.plaf.basic.BasicButtonListener.mouseReleased(未知   来自)java.awt.Component.processMouseEvent(未知来源)at   javax.swing.JComponent.processMouseEvent(未知来源)at   java.awt.Component.processEvent(未知来源)at   java.awt.Container.processEvent(未知来源)at   java.awt.Component.dispatchEventImpl(未知来源)at   java.awt.Container.dispatchEventImpl(未知来源)at   java.awt.Component.dispatchEvent(未知来源)at   java.awt.LightweightDispatcher.retargetMouseEvent(未知来源)at   java.awt.LightweightDispatcher.processMouseEvent(未知来源)at   java.awt.LightweightDispatcher.dispatchEvent(未知来源)at   java.awt.Container.dispatchEventImpl(未知来源)at   java.awt.Window.dispatchEventImpl(未知来源)at   java.awt.Component.dispatchEvent(未知来源)at   java.awt.EventQueue.dispatchEventImpl(未知来源)at   java.awt.EventQueue.access $ 000(未知来源)at   java.awt.EventQueue $ 3.run(未知来源)at   java.awt.EventQueue $ 3.run(未知来源)at   java.security.AccessController.doPrivileged(Native Method)at   java.security.ProtectionDomain $ 1.doIntersectionPrivilege(未知   来源)at   java.security.ProtectionDomain $ 1.doIntersectionPrivilege(未知   来自)java.awt.EventQueue $ 4.run(未知来源)at   java.awt.EventQueue $ 4.run(未知来源)at   java.security.AccessController.doPrivileged(Native Method)at   java.security.ProtectionDomain $ 1.doIntersectionPrivilege(未知   来自)java.awt.EventQueue.dispatchEvent(未知来源)at   java.awt.EventDispatchThread.pumpOneEventForFilters(未知来源)     at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)     在java.awt.EventDispatchThread.pumpEventsForHierarchy(未知   来自java.awt.EventDispatchThread.pumpEvents(未知来源)     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)at   java.awt.EventDispatchThread.run(未知来源)

我该怎么办?数值不在数据库中                                                                                           这是launch4j的日志文件:

CmdLine:    C:\Users\bhawna\Desktop\ttf1.exe --l4j-debug
WOW64:      yes
Check launcher:  (n/a)
64-bit search:  SOFTWARE\JavaSoft\Java Runtime Environment...
Match:      SOFTWARE\JavaSoft\Java Runtime Environment\1.6
Match:      SOFTWARE\JavaSoft\Java Runtime Environment\1.6.0_32
Match:      SOFTWARE\JavaSoft\Java Runtime Environment\1.7
Match:      SOFTWARE\JavaSoft\Java Runtime Environment\1.7.0
Using 64-bit runtime.
64-bit search:  SOFTWARE\JavaSoft\Java Development Kit...
Ignore:     SOFTWARE\JavaSoft\Java Development Kit\1.7
Ignore:     SOFTWARE\JavaSoft\Java Development Kit\1.7.0
Using 64-bit runtime.
Check launcher: C:\Program Files\Java\jre7\bin\javaw.exe (OK)
Add classpath:  mysql-connector-java-5.0.8-bin.jar
Add classpath:  beansbindings-1.2.1.jar
Launcher:   C:\Program Files\Java\jre7\bin\javaw.exe
Launcher args:  -classpath "C:\Users\bhawna\Desktop\ttf1.exe;mysql-connector-java-5.0.8-bin.jar;beansbindings-1.2.1.jar" ngo_interface.NewJFrame
Args length:    128/32768 chars
Exit code:  0

1 个答案:

答案 0 :(得分:1)

只需在classpath中添加mysql-connector jar文件