https://github.com/quasilyte/go-jdk
Run JVM-based code in Go efficiently
https://github.com/quasilyte/go-jdk
embedded go go-jdk go-jre gojdk golang interpreter jdk jit jre jvm vm
Last synced: 6 months ago
JSON representation
Run JVM-based code in Go efficiently
- Host: GitHub
- URL: https://github.com/quasilyte/go-jdk
- Owner: quasilyte
- License: mit
- Created: 2020-01-31T22:35:36.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-01-31T09:03:05.000Z (8 months ago)
- Last Synced: 2025-04-02T06:48:40.162Z (6 months ago)
- Topics: embedded, go, go-jdk, go-jre, gojdk, golang, interpreter, jdk, jit, jre, jvm, vm
- Language: Go
- Size: 373 KB
- Stars: 74
- Watchers: 6
- Forks: 7
- Open Issues: 28
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-jdk

[go-jdk](https://github.com/quasilyte/go-jdk) is [OpenJDK](https://ru.wikipedia.org/wiki/OpenJDK)-like implementation
written in Go with a goal to deliver a great embeddable [JVM](https://en.wikipedia.org/wiki/Java_virtual_machine) for
[Go](http://golang.org/) applications without [CGo](https://golang.org/cmd/cgo/).Key features:
* JVM bytecode converted to [register-based form](https://www.usenix.org/legacy/events%2Fvee05%2Ffull_papers/p153-yunhe.pdf)
* Loaded code is JIT-compiled right away, no run-time tracing involved
* Efficient `Go->JVM` calls
* Efficient `JVM->Go` calls
* `native` Java methods can be written in Go> Note: this project is in its early state.
```bash
# Run Java class method (main or any other static method):
go-jdk run -class Foo.class -method helloWorld# Disassemble Java class file with go-jdk:
go-jdk javap Foo.class# Print IR representation instead of JVM bytecode:
go-jdk javap -format=ir Foo.class# Print Java class dependencies:
go-jdk jdeps Foo.class
```