使用 Java 开发并生成 .jar 文件

1. 编写文件 D:\test\Hello.java:

1 package test;
2 
3 public class Hello
4 {
5     public static void main(String argv[])
6     {
7         System.out.println("Hello, world");
8     }
9 }

2. 编译,得到 Hello.class 文件。

 1 D:\>javac -target 1.2 test/Hello.java 

3. 使用 jar.exe 工具生成 test.jar 文件

 1 D:\>jar cvf test.jar test/Hello.class 

 

jar2exe:

http://www.regexlab.com/zh/jar2exe/demo1.htm

posted @ 2014-11-07 16:15  晕菜一员  阅读(218)  评论(0编辑  收藏  举报