我有一个工程shop 主类在com.younger.shop(启动类)
还用到了一个外部包 datechooser.jar
在C:\Documents and Settings\Administrator\workspace打包
打包命令是 jar cvfm shop.jar manifest.mf shop/
manifest 清单是
Main-Class: com.younger.shop
Class-Path: datechooser.jar打包好后运行 shop.jar 跳出 could not find the main class program will exit 急啊
还用到了一个外部包 datechooser.jar
在C:\Documents and Settings\Administrator\workspace打包
打包命令是 jar cvfm shop.jar manifest.mf shop/
manifest 清单是
Main-Class: com.younger.shop
Class-Path: datechooser.jar打包好后运行 shop.jar 跳出 could not find the main class program will exit 急啊
可能是这一句的问题,你后面的Main-Class:后面是一个空格在写上主类的名字。
如果你的格式都对的话,应该就是jar 命令参数不对吧,改一下路径试试看
或者到你的工作目录下把shop/改成*.class看看
主类路径要给全,包含主CLASS
带个-C命令看看
jar cvfm shop.jar manifest.mf -C shop/还是不行,用winrar、7zip之类的把刚那个JAR包打开,看看类的路径对不对,还有META-INF中的manifest的内容对不对。
-C 这个可以不用的,
可能是在Main-Class: com.younger.shop 中
没有给出类的全名,在com.younger.shop 前加上一层目录名
Class-Path: ./bb.jar
Main-Class: com.hw.Test