sjvm
v0.1.51
Published
**Simple Java Version Manager CLI**
Readme
jvm
Simple Java Version Manager CLI
Repository: https://github.com/Goktas44
📦 Installation
Install globally via npm:
npm install -g sjvmNote: On Windows, the installer will automatically append
%JAVA_HOME%\\binto your user PATH. On macOS/Linux, add the following line to your shell profile (~/.bashrc,~/.zshrc, etc.) if you haven’t already:
export PATH="$JAVA_HOME/bin:$PATH"🚀 Usage
After installation, use the jvm command in your terminal:
jvm <command> [options]You can also use these aliases:
jvm ls⇒jvm listjvm i⇒jvm installjvm u⇒jvm usejvm rm⇒jvm uninstall
📋 Commands
list / ls
List all installed JDK versions.
The currently active version is marked with * and labeled (current).
jvm lsOptions:
-v, --verboseShow full installation paths.
install / i
Download and install the specified JDK version into ~/.jvm/versions/jdk-<version>.
Default version:
17if none is specified.Default vendor:
oracleif none is specified.Interactive vendor selection: If you run
jvm installwithout providing a vendor (or provide an unrecognized vendor), you will be prompted to choose from:- Oracle
- Temurin (Adoptium)
- Corretto (Amazon)
- Liberica (BellSoft)
Example interactive session:
$ jvm install <version>
Which JDK distribution would you like to install?
Oracle
Temurin
> Corretto
Liberica# Install JDK 17 from Oracle (default)
jvm install
# Install JDK 11 from Temurin explicitly
jvm install 11 temurinuse / u
Switch your active JDK to <version>.
– On Windows, sets %JAVA_HOME% system-wide.
– On macOS/Linux, prints an export JAVA_HOME=… command you can eval.
jvm use 17
# or
eval "$(jvm use 11.0.16)"uninstall / rm
Remove a previously installed JDK version.
jvm uninstall 11
# or
jvm rm jdk-11.0.16🛠️ Examples
# List installed versions
jvm ls
# Install default JDK (17/Oracle)
jvm install
# Install JDK 21 (Oracle by default)
jvm install 21
# Install JDK 11 from Temurin
jvm install 11 temurin
# Switch to JDK 21
eval "$(jvm use 21)"
# Uninstall JDK 16
jvm rm 16⚙️ Shell Integration (macOS/Linux)
To make jvm use automatically update your PATH, add this to your profile:
# ~/.bashrc or ~/.zshrc
export PATH="$JAVA_HOME/bin:$PATH"Then reload:
source ~/.bashrc # or source ~/.zshrc🤝 Contributing
Contributions, issues and feature requests are welcome! Feel free to check issues or open a pull request.
📄 License
MIT © Abdurrahman Göktaş
Enjoy working with multiple JDK versions!
