jar {ctxui}[vfmn0PMe] [jar-file] [manifest-file] [entry-point] [-C dir] files ...
复制代码
jar命令是打包,命令很类似ta
{}参数(只能选一个)
参数阐明c打包成成为jar基本不消x解压jart显示jar中的内容u更新jarx或i没试过[]参数
重要参数阐明m指定MANIFEST文件f打包的jar的名字,这个参数不传会output will go to a stdout(什么人或者为啥要go to stdout?)e可以指定class的入口。C去掉指定的目录层级。看实例。不重要参数v打包时,显示详细的信息0不压缩。不压缩的jar据oracle网站说运行更快,压缩体积更小Mjar内不要MANIFEST,为啥不要?留意:
自定义的MF文件末了一行不会被写入到jar包中的MANIFEST.MF中,以是自定义的MF文件末了一行必须是空行
来源: Modifying a Manifest File,Warning: The text file from which you are creating the manifest must end with a new line or carriage return. The last line will not be parsed properly if it does not end with a new line or carriage return.