@ringotangs/jenv
v0.1.3
Published
A cross-platform JDK version management tool
Maintainers
Readme
jenv
A cross-platform JDK version management tool that allows you to easily switch between different JDK versions.
Features
- 🚀 Easy JDK version switching
- 💻 Cross-platform support (Windows, Linux, MacOS)
- ⚡️ Simple CLI interface
- 🔧 Easy configuration
- 🎯 Symbolic link based version switching
Please note:
jenv does not automatically download JDKs for you. You need to manually download multiple versions of the JDK and place them in the specified directory.
Installation
npm install -g @ringotangs/jenvRequirements
- Node.js >= 16.20.2
- Administrator privileges (Windows) or sudo (Linux/MacOS) for creating symbolic links
Usage
Initialize jenv
First time setup:
jenv initConfigure JDK Paths
Add your JDK installations:
jenv configThis will guide you through:
- Adding new JDK paths
- Removing existing configurations
- Listing current configurations
List Available JDKs
View all configured JDK versions:
jenv lsSwitch JDK Version
Change the active JDK:
jenv useAfter switching versions, you'll need to configure your environment:
Windows
Set environment variables:
JAVA_HOME=<jenv_path>\jdk
Add %JAVA_HOME%\bin to your PATHLinux/MacOS
Add to ~/.bashrc or ~/.zshrc:
bash
export JAVA_HOME="<jenv_path>/jdk"
export PATH="$JAVA_HOME/bin:$PATH"Note: Restart your terminal after changing versions to apply the changes.
Windows Users Note
On Windows, you'll need either:
- Run the command prompt as Administrator, or
- Enable Developer Mode in Windows Settings
This is required for creating symbolic links.
License
MIT
Author
RingoTangs
Contributing
- Fork it
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
