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
转载于:https://www.cnblogs.com/CharlesGrant/p/4081621.html