#java #toolchain #sdkman #jbang

bin+lib wukong

Wukong is a command-line toolchain for Java with Rust

5 releases

new 0.2.2 Oct 16, 2024
0.2.1 Oct 7, 2024
0.2.0 Sep 25, 2024
0.1.3 Sep 19, 2024
0.1.0 Sep 12, 2024

#966 in Command line utilities

Download history 80/week @ 2024-09-09 183/week @ 2024-09-16 184/week @ 2024-09-23 54/week @ 2024-09-30 170/week @ 2024-10-07 181/week @ 2024-10-14

606 downloads per month

Apache-2.0

260KB
6.5K SLoC

Rust 4K SLoC // 0.0% comments Shell 2K SLoC // 0.1% comments Java 37 SLoC // 0.1% comments Zsh 14 SLoC BASH 13 SLoC Kotlin 3 SLoC // 0.4% comments Groovy 1 SLoC // 0.7% comments

Wukong - Java Toolchain with Rust

Wukong is a Java toolchain written with Rust.

Why write Java toolchain with Rust?

  • startup time matter: Rust is fast, and Java takes ages to start.
  • No environment dependencies: No need to install JDK, Maven, Gradle, etc.
  • Binary file size matter: 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: ~/.cargo/bin/jbang --version
  • SDKMAN-rs: ~/.cargo/bin/sdk --version
  • jenv-rs: ~/.cargo/bin/jenv --version
  • Maven Toolchains: ~/.cargo/bin/mt --version

Java Toolchains

Maven Toolchains CLI

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

Add JDK

  • 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

direnv integration

Integration with direnv by sdk direnv init:

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

References

  • SDKMAN CLI: SDKMAN CLI Native with Rust
  • OneIO: all-in-one convenient IO library for Rust
  • startup-time: Measure startup time of different programming languages

Dependencies

~25–42MB
~764K SLoC