一个简单的jar包提问,但是我还在困惑中.......

temony 2003-09-11 11:13:12
我用

jar cvf classes.jar classes

生成了一个classes.jar 文件但是此jar文件中的MANIFEST.MF内容是

Manifest-Version: 1.0
Created-By: 1.4.1-rc (Sun Microsystems Inc.)

我如何能让他变成
Main-Class: mytest.demo

(注:demo.class中有main函数,是程序的入口)
...全文
38 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
temony 2003-09-11
  • 打赏
  • 举报
回复
谢谢fast_time(fast_time) 和 mayanwei() ( ) 问题解决,不过fast_time(fast_time)导入的MANIFEST.MF文件在根目录上,而不是在META-INF目录中.
mayanwei 2003-09-11
  • 打赏
  • 举报
回复
jar cmf manifest-addition jar-file input-file(s)

manifest-addition is the name (or path and name) of the existing text file whose contents you want included in the JAR file's manifest.
manifest-addition 是楼主想要的manifest内容 它可以是一个文本文件 程序会自动把其中内容copy至manifest中...

jar-file is the name that you want the resulting JAR file to have.
jar-file是生成的jar的名字

The input-file(s) argument is a space-separated list of one or more files that you want to be placed in your JAR file.
这个是所有需要打包的文件列表

-_,-
fast_time 2003-09-11
  • 打赏
  • 举报
回复
自己写一个MANIFEST.MF
jar -cvf classes.jar -m MANIFEST.MF classes

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧