mirror of
https://github.com/FranzHaidnor/haidnorJVM.git
synced 2026-03-13 21:43:42 +08:00
update README.md pom.xml
This commit is contained in:
@@ -79,7 +79,7 @@ public void test() throws Exception {
|
||||
值得注意的是,这种方式编译运行的字节码文件是基于 java17 版本的。
|
||||
|
||||
## 运行 .class 文件
|
||||
1. 使用 maven 命令将 haidnorJVM 编译打包,得到 `haidnorJVM-1.0.jar` 文件
|
||||
1. 使用 maven 命令将 haidnorJVM 编译打包,得到 `haidnorJVM.jar` 文件
|
||||
2. 编写一个简单的程序,例如以下代码
|
||||
```java
|
||||
public class HelloWorld {
|
||||
@@ -89,12 +89,12 @@ public void test() throws Exception {
|
||||
}
|
||||
```
|
||||
3. 编译代码,得到 HelloWorld.class 文件。(推荐使用 JDK8 进行编译)
|
||||
4. 使用 haidnorJVM 运行程序。执行命令 `java -jar haidnorJVM-1.0-SNAPSHOT.jar -class R:\HelloWorld.class`。注意需要 class 文件的绝对路径
|
||||
4. 使用 haidnorJVM 运行程序。执行命令 `java -jar haidnorJVM.jar -class R:\HelloWorld.class`。注意需要 class 文件的绝对路径
|
||||
|
||||
## 运行 .jar 文件
|
||||
1. 使用 maven 命令将 haidnorJVM 编译打包,得到 `haidnorJVM-1.0.jar` 文件
|
||||
1. 使用 maven 命令将 haidnorJVM 编译打包,得到 `haidnorJVM.jar` 文件
|
||||
2. 编写一个 java 项目编译打包成 .jar 文件,例如 demo.jar。要求 .jar 文件中的 META-INF/MANIFEST.MF 文件内有 `Main-Class` 属性 (含有 public static void main(String[] args) 方法的主类信息)
|
||||
3. 使用 haidnorJVM 运行程序。执行命令 `java -jar haidnorJVM-1.0-SNAPSHOT.jar -class R:\demo.jar`。注意需要 jar 文件的绝对路径
|
||||
3. 使用 haidnorJVM 运行程序。执行命令 `java -jar haidnorJVM.jar -class R:\demo.jar`。注意需要 jar 文件的绝对路径
|
||||
|
||||
# 联系作者
|
||||

|
||||
|
||||
Reference in New Issue
Block a user