`

war文件

阅读更多
作为java或准确一点的J2EE的部署来说,没有人对war文件有任何的怀疑的,因为这是司空见惯的事情。加上tomcat的部署默认要求又不是很严格,所以一直对war文件的解压或压缩感到陌生。这可不,今天就遇到一个解压.war后缀的文件,google了一把,才知道它是个zip文件。
感谢论坛的朋友作如下的回答:
It is a special jar file.

A jar file is a special zip file.

So jar or unzip will do.

其他的我也不去深度的挖掘了,在这里列出jar --help的内容,他本身和zip的功能没多少区别,但是它可以将java的字节码文件打包,并执行。
lee@lee-laptop:~/tmp/middsoftware/pluto-1.1.3/webapps$ jar --help
Usage: jar {ctxuV}[vfm0ME@] [jar-file] [manifest-file] [-C dir] files ...

Store many files together in a single `jar' file.

  -c              create new archive
  -t              list table of contents for archive
  -x              extract named (or all) files from archive
  -u              update existing archive

  -@              read names from stdin
  -0              store only; use no ZIP compression
  -C DIR FILE     change to the specified directory and include
                  the following file
  -E              don't include the files found in a directory
  -f FILE         specify archive file name
  --help          print this help, then exit
  -m FILE         include manifest information from specified manifest file
  -M              Do not create a manifest file for the entries
  -i              generate an index of the packages in this jar
                  and its Class-Path (currently unimplemented)
  -v              generate verbose output on standard output
  -V, --version   display version information

If any file is a directory then it is processed recursively.
The manifest file name and the archive file name needs to be specified
in the same order the 'm' and 'f' flags are specified.

Example 1: to archive two class files into an archive called classes.jar:
     jar cvf classes.jar Foo.class Bar.class
Example 2: use an existing manifest file 'mymanifest' and archive all the
     files in the foo/ directory into 'classes.jar':
     jar cvfm classes.jar mymanifest -C foo/ .
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics