zxh0/jvm.go
A toy JVM written in Go
{ "createdAt": "2015-01-07T08:46:46Z", "defaultBranch": "master", "description": "A toy JVM written in Go", "fullName": "zxh0/jvm.go", "homepage": "", "language": "Go", "name": "jvm.go", "pushedAt": "2019-12-04T14:16:37Z", "stargazersCount": 3615, "topics": [ "golang", "jvm" ], "updatedAt": "2025-11-21T07:48:11Z", "url": "https://github.com/zxh0/jvm.go"}jvm.go
Section titled “jvm.go”A JVM written in Go. ![jvm.go Logo]!(logo.png)
Introduction
Section titled “Introduction”jvm.go is a toy JVM (which is far from complete) programmed in Go. The main purpose of this project is learning Go and the JVM. So the number one goal of the project is readability of code. The basic idea is to just implement the core JVM, and use rt.jar (from OpenJDK) as its class library. The garbage collector is implemented by directly using Go’s GC.
My dev environment
Section titled “My dev environment”- Mac OS X 10.13.6
- Java 1.8.0_201
- Go 1.12
Build jvm.go
Section titled “Build jvm.go”git clone https://github.com/zxh0/jvm.go.gitcd jvm.gogo build github.com/zxh0/jvm.go/cmd/javaRun jvm.go using your Java installation
Section titled “Run jvm.go using your Java installation”Check your Java version and ensure JAVA_HOME env was set
./java -XuseJavaHome -cp path/to/jars:path/to/classes HelloWorldRun jvm.go using Zulu
Section titled “Run jvm.go using Zulu”Download zulu jdk 8 (Zulu is a certified build of OpenJDK that is fully compliant with the Java SE standard.) and unzip it to somewhere, Copy jvm.go/java into unzipped folder
cd path/to/zulu8-macosxcp path/to/jvm.go/java jvmgojvmgo -cp path/to/jars:path/to/classes HelloWorld