I'm on the hunt for a lightweight and customizable JVM that won't be a resource hog. Ideally, I'm after an open-source option so I can dive into the code and make adjustments as needed. I've already ruled out production JVMs like Graal and HotSpot since their source code is too complex for my customization needs.
Here's what I'm looking for:
a) It should support at least Java 1.1.
b) I only need the JRE (the runtime, not the full JDK, so just 'java' or its equivalent executable is necessary, no extra tools).
c) It needs to be written in a compiled language, not Java (C, C++, Rust, or Go would be great).
d) The source code should be easily modifiable.
So far, I've checked out Jikes RVM (though it requires a JVM to run) and Kaffee (which hasn't been maintained in 14 years), but I'd love to hear about any other options you might know about. Thanks for any help!
6 Answers
How about checking out [Avian](https://github.com/ReadyTalk/avian)? It's another lightweight JVM option, although it seems to be discontinued. IIRC, it was pretty efficient.
There’s a Rust implementation called [rust-jvm](https://github.com/pirocks/rust-jvm) that could fit your requirements. Additionally, consider creating a minimal JDK using JLink from OpenJDK, which allows you to tailor the build to your needs. Here's how you can get started with it: [JLink Documentation](https://docs.oracle.com/en/java/javase/11/tools/jlink.html).
You could try using OpenJDK with the Zero port: [OpenJDK Zero Project](https://openjdk.org/projects/zero/). It allows you to cut back on features which can help reduce resource usage. You can further minimize the image using JLink to remove unnecessary Java modules.
You might want to look into a Go-written JVM as well. It's actively maintained, though it does miss a few features. Check out [Jacobin](https://github.com/platypusguy/jacobin) for that.
If you're looking for Rust-based JVMs, one to check out is [rjvm](https://github.com/andreabergia/rjvm). It uses the real rt.jar from Java 7, so it should be fairly decent. There's also [Jacobin](https://github.com/platypusguy/jacobin), which is worth a look, although it lacks JIT and JNI support and has some features still in development.
Related Questions
How To: Running Codex CLI on Windows with Azure OpenAI
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically