Thanks to visit codestin.com
Credit goes to lib.rs

#java #toolchain #sdkman #jbang

bin+lib wukong

Wukong is a command-line toolchain for Java with Rust

11 releases

Uses new Rust 2024

new 0.3.1 Jan 18, 2026
0.3.0 Jul 18, 2025
0.2.8 Apr 30, 2025
0.2.6 Dec 3, 2024
0.1.3 Sep 19, 2024

#2243 in Command line utilities

Apache-2.0

370KB
9K SLoC

Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App

Wukong - Java Toolchain with Rust

Wukong is a Java toolchain written with Rust.

Why write a Java toolchain with Rust?

  • Startup time matters: Rust is fast, and Java takes ages to start.
  • No environment dependencies: No need to install JDK with different versions.
  • Binary file size matters: small size, easy to distribute. GraalVM native-image is not small enough.

Get started

  • Install: cargo binstall wukong. Please run cargo install cargo-binstall first.
  • JBang-rs: Run Java code ~/.cargo/bin/jbang --help
  • SDKMAN-rs: Manage JDK and tools ~/.cargo/bin/sdk --help
  • Maven Central Search: Artifact search ~/.cargo/bin/mcs --help
  • JAR file analyzer: artifact analyzer ~/.cargo/bin/jarviz --help
  • Maven Toolchains: ~/.cargo/bin/mt --help
  • jenv-rs: ~/.cargo/bin/jenv --help

Java Toolchains

SDKMAN-rs

Please add eval $(~/.cargo/bin/sdk init) to your shell profile.

enhancements

  • CI friendly: sdk install -y java for auto-install
  • Silent mode: sdk -q install java
  • Major version support(Temurin by default): sdk install java 21, sdk use java 21

Difference

  • use version: eval $(sdk use java 21)

Maven Toolchains CLI

  • jdks: list all installed JDKs
  • vendors: list all vendors and available JDK versions.
  • list: list JDKs from ~/.m2/toolchains.xml
  • add: add JDK into ~/.m2/toolchains.xml
  • remove: remove JDK from ~/.m2/toolchains.xml

Add JDK

  • list all vendors and jdk versions: mt vendors
  • mt add 21: add JDK 21 from $HOME/.jbang/cache/jdks/21
  • mt add 17.0.4-tem: add JDK from $HOME/.sdk/candidates/java/17.0.4-tem
  • mt add /path/to/java-home: add JDK from /path/to/java-home

jarviz

jarviz is a JAR file analyzer written in Rust, and inspired by kordamp/jarviz.

  • bytecode matric: jarviz bytecode matrix
  • bytecode show: jarviz bytecode show --pom
  • entries list: jarviz entries list --file=path/to/jarfile.jar
  • services list: jarviz services list --pom

jaz

jaz: a lightweight utility that simplifies how Java developers run their applications on JDK 17+.

Detected variables:

  • JAVA_HOME
  • JAVA_VERSION
  • JAVA_VENDOR
  • JAVA_OPTIONS

Features:

  • .env support with dotenvx

Roadmap

  • ⚙️ JVM configuration profiles
  • 📦 AppCDS support
  • 🔄 Continuous tuning
  • 📊 Telemetry
  • 📦 Leyden support

direnv integration

Integration with direnv by sdk direnv init:

  • Java Home: .java-version, .sdkmanrc
  • Aut candidate home and path for SDKMAN: .sdkmanrc

References

Dependencies

~36–61MB
~1M SLoC