看板 java 關於我們 聯絡資訊
我寫了一支JAVA, 在OS為WIN SERVER 2003時執行時,complie成功,且可也可成功執行。 可是將一模一樣的JDK和環境變數以及程式,設置在WIN SERVER 2008時, compile成功,也正常出現compile過的class檔,但是卻無法執行, 用cmd看出現的錯誤為 Exception in thread "main" java.lang.NoClassDefFoundError: EIPRetailexport Caused by: java.lang.ClassNotFoundException: EIPRetailexport at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) Could not find the main class: EIPRetailexport. Program will exit. 不曉得這跟OS有沒有關係呢? -- 請勿拍打、餵食 http://www.wretch.cc/album/etchen -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 218.211.33.46
superlubu:跟 classpath 比較有關吧 ? 07/15 16:28
etchen:已解決了,classpath要加.; 07/15 16:32