开发者

creation of jar failing

开发者 https://www.devze.com 2023-03-11 20:44 出处:网络
I am trying to create a jar using the following command on a RHEL box jar -cf first MANIFEST.TXT HelloWorld.class

I am trying to create a jar using the following command on a RHEL box

jar -cf first MANIFEST.TXT HelloWorld.class 

the contents of MANIFEST.TXT is Main-Class: HelloWorld

This is failing with the following error Failed to load Main-Class manifest attribute from first

I understand i need to create the manifest file which has Main-Class开发者_开发技巧 manifest even with this I cannot execute java -jar first without an error

Thanks Bhavya


See the example from jar -help:

jar cvfm classes.jar mymanifest -C foo/ .

You must specify m so jar knows there is a manifest file and you should not omit the .jar from first. This should work:

jar cfm first.jar MANIFEST.TXT HelloWorld.class 
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号