2013-01-06 43 views
-1

我創建了一個成功創建的Java應用程序的exe文件。但是當我嘗試執行並在顯示的表單中放置一些值時,按提交按鈕,顯示錯誤:執行Java應用程序時launch4j中的錯誤

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(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 java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at ngo_interface.eventdetail.jButton1ActionPerformed(eventdetail.java:192) at ngo_interface.eventdetail.access$300(eventdetail.java:20) at ngo_interface.eventdetail$4.actionPerformed(eventdetail.java:89) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.setPressed(Unknown Source) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source) at java.awt.Component.processMouseEvent(Unknown Source) at javax.swing.JComponent.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$000(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source)

我該怎麼辦?這些值不在數據庫中。
這是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 
+0

數據庫驅動程序無法找到。您需要指定launch4j所需的所有依賴項,以將其包含在Java的類路徑中。如何做到這是另一個問題 – MadProgrammer

+0

這是launch4j的日誌文件: – user1502308

回答

1

只需添加使用mysql-connector jar文件在類路徑

+0

我已經在類路徑中添加了mysql-connector-java-5.0.8-bin.jar。但它仍然不起作用。我也嘗試在launch4j本身中添加類路徑,但仍顯示相同的錯誤。 :( – user1502308

+0

你運行的jar文件沒有exe文件? –

+0

我已經使用launch4j exe文件,現在我正在嘗試執行它。 – user1502308

相關問題