jvm_on_go

package module
v0.0.0-...-eb536d9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2023 License: Apache-2.0 Imports: 0 Imported by: 0

README

Jvm On Go

使用golang基于JVM8 Spec 构建的简易JVM,仅供学习使用。

Roadmap

  • 类加载
  • 字节码解析
  • 类解析及初始化
  • 字节码解释器
  • 单线程
  • 部分Native方法(使用golang实现)
  • invokedynamic
  • Lambda

Getting Started

1. 环境准备
  • 本地需要Java8运行环境并且设置JAVA_HOME环境变量
  • 若是通过源码构建,本地需要安装golang(>= 1.15)
2. 源码构建
git clone https://github.com/rodbate/jvm-on-go.git
cd jvm-on-go && go build -o jvm
3. 下载二进制包
#windows
wget https://github.com/rodbate/jvm-on-go/releases/download/1.0.0/jvm-windows

#linux
wget https://github.com/rodbate/jvm-on-go/releases/download/1.0.0/jvm-linux

#mac os
wget https://github.com/rodbate/jvm-on-go/releases/download/1.0.0/jvm-darwin

以上都是基于64位系统

4. 使用

testdata目录下有几个简单的java示例

比如:

//ChineseSupportSample.java
//ChineseSupportSample.class
public class ChineseSupportSample {
    public static void main(String[] args) {
        for (int i = 0; i < 1000; i++) {
            System.out.println("中文 - Hello world: " + i);
        }
    }
}

输入以下命令即可运行

./jvm run -c testdata ChineseSupportSample

Documentation

Index

Constants

View Source
const Version = "v1.0.0"

Variables

This section is empty.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL