8 releases
new 0.2.6 | Dec 3, 2024 |
---|---|
0.2.5 | Nov 11, 2024 |
0.2.4 | Oct 29, 2024 |
0.2.0 | Sep 25, 2024 |
0.1.3 | Sep 19, 2024 |
#927 in Command line utilities
285 downloads per month
280KB
7K
SLoC
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 runcargo 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
- JBang(Java): https://www.jbang.dev/
- SDKMAN(bash): https://sdkman.io/
- jenv(bash): https://github.com/jenv/jenv
- Maven Toolchains CLI: https://maven.apache.org/guides/mini/guide-using-toolchains.html
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
Dependencies
~24–40MB
~700K SLoC