update README.md pom.xml

This commit is contained in:
wangxiang
2023-07-26 09:40:11 +08:00
parent 87114630f4
commit f5e2af2909
2 changed files with 5 additions and 4 deletions

View File

@@ -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 文件的绝对路径
# 联系作者
![](/readme/20230721181408.png )

View File

@@ -59,6 +59,7 @@
</dependencies>
<build>
<finalName>haidnorJVM</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>