Manifest.mf文件内容: Manifest-Version: 1.0 Main-Class: com.mycompany.test.myApp Created-By: 1.3.0 (Sun Microsystems Inc.)Dos命令行输入: C:\mytest>jar cvfm myApp.jar Manifest.mf com\mycompany\test\*.class这些写法对么?为什么一直提示Could not find the main class. Program will exit!
to rinehart 我用的是默认的jarw.exe来执行 to snmmc(冬瓜(菜鸟版)) 正如你所说的那样,我在前面已经提到用 C:\mytest>jar cvfm myApp.jar Manifest.mf com\mycompany\test\*.class 来打包(Manifest.mf在c:\mytest下) 可是在双击myApp.jar时依然弹出上面所说的错误提示 Could not find the main class. Program will exit! 这是怎么回事?谢谢各位!
sorry,写错了 to rinehart 我用的是默认的javaw.exe来执行
你用java -jar myApp.jar看看会不会有结果!
javaw -jar myApp.jar没问题 javaw myApp.jar就会出你所说的提示!
Exception in thread "main" java.lang.NoClassDefFoundError: org/w3c/dom/Node 还是不行呀,不过换了个提示罢了 org/w3c/dom/Node在另一个包里,怎么办?
Manifest-Version: 1.0
Main-Class: com.mycompany.test.myApp
Created-By: 1.3.0 (Sun Microsystems Inc.)Dos命令行输入:
C:\mytest>jar cvfm myApp.jar Manifest.mf com\mycompany\test\*.class这些写法对么?为什么一直提示Could not find the main class. Program will exit!
内容如下:
Main-Class: com.mycompany.test.myApp然后进入c:\mytest>jar cvfm test.jar mymain.txt com\mycompany\test\*.*
先试试,看行不行。随时联系
我用的是默认的jarw.exe来执行
to snmmc(冬瓜(菜鸟版))
正如你所说的那样,我在前面已经提到用
C:\mytest>jar cvfm myApp.jar Manifest.mf com\mycompany\test\*.class
来打包(Manifest.mf在c:\mytest下)
可是在双击myApp.jar时依然弹出上面所说的错误提示
Could not find the main class. Program will exit!
这是怎么回事?谢谢各位!
to rinehart
我用的是默认的javaw.exe来执行
javaw myApp.jar就会出你所说的提示!
还是不行呀,不过换了个提示罢了
org/w3c/dom/Node在另一个包里,怎么办?
老老实实开个dos窗口!
只要classpath对!
java -jar myApp.jar
没问题!
java就这一点不爽!sigh!
慢,还老出现乱七八糟莫名其妙的错误
真受不了!
可惜现在还要忍!!!
算了,给分吧