作者etchen (Mier)
看板java
标题[问题] compile成功但却无法执行
时间Thu Jul 15 15:41:50 2010
我写了一支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
1F:→ superlubu:跟 classpath 比较有关吧 ? 07/15 16:28
2F:→ etchen:已解决了,classpath要加.; 07/15 16:32