wukong

Crates.iowukong
lib.rswukong
version0.2.6
sourcesrc
created_at2024-09-12 05:04:51.701192
updated_at2024-12-03 13:28:23.549224
descriptionWukong is a command-line toolchain for Java with Rust
homepagehttps://github.com/linux-china/wukong
repositoryhttps://github.com/linux-china/wukong
max_upload_size
id1372483
size370,695
Libing Chen (linux-china)

documentation

https://github.com/linux-china/wukong

README

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 --help
  • SDKMAN-rs: ~/.cargo/bin/sdk --help
  • jenv-rs: ~/.cargo/bin/jenv --help
  • Maven Toolchains: ~/.cargo/bin/mt --help
  • Maven Repository Search: ~/.cargo/bin/mcs --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 17, sdk use java 17

Difference

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

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

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
Commit count: 403

cargo fmt