Skip to content

RingoTangs/jenv

Repository files navigation

English

简体中文

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/jenv

Requirements

  • Node.js >= 16.20.2
  • Administrator privileges (Windows) or sudo (Linux/MacOS) for creating symbolic links

Usage

Initialize jenv

First time setup:

jenv init

Configure JDK Paths

Add your JDK installations:

jenv config

This will guide you through:

  1. Adding new JDK paths
  2. Removing existing configurations
  3. Listing current configurations

List Available JDKs

View all configured JDK versions:

jenv ls

Switch JDK Version

Change the active JDK:

jenv use

After switching versions, you'll need to configure your environment:

Windows

Set environment variables:

JAVA_HOME=<jenv_path>\jdk
Add %JAVA_HOME%\bin to your PATH

Linux/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:

  1. Run the command prompt as Administrator, or
  2. Enable Developer Mode in Windows Settings

This is required for creating symbolic links.

License

MIT

Author

RingoTangs

About

A cross-platform JDK version management tool

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published