`

如何打包jar

    博客分类:
  • Java
阅读更多

jar cvf my.jar helloword.class
将helloword.class打包为my.jar
说明:
-c  创建新的包
-v  生成详细输出到你的dos窗口上
-f  指定你的包名

示例2:将两个class文件打包到一个名为 'classes.jar' 的包中:
       jar cvf classes.jar Foo.class Bar.class

示例3:将一个名为file文件夹打包到一个名为myfile.jar的包中
jar cvf myfile.jar file

示例4:将一个名为file文件夹下的所有内容打包到一个名为myfile.jar的包中
jar cvf myfile.jar file/*

上面的例子dos和文件都是在当前目录,
还有更多的例子,也不知道你还有哪些不知道

生成直接可以运行的jar包
http://hi.baidu.com/lovebwf/blog/item/602869a78849c090d14358ef.html

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics