Skip to the content.

Java Version Manager (JVM)

A lightweight, high-performance, color-coded Windows command-line utility designed to dynamically discover, download, and switch Java Development Kits (JDKs) and the entire JVM Ecosystem (Maven, Gradle, Kotlin, Scala, Groovy) with native SDKMAN! parity.

📥 Installation

Open Windows PowerShell (no Administrator privileges required) and paste the following one-liner:

Invoke-WebRequest -Uri "https://raw.githubusercontent.com/DiamTek/Java-Version-Manager-Windows/main/install.ps1" -OutFile "$env:TEMP\install.ps1"; & "$env:TEMP\install.ps1"

This instantly downloads the core engine, provisions %LOCALAPPDATA%\DiamTek\JVM, registers the Windows uninstaller, and updates your PowerShell Profile so the jvm command is available everywhere.

Or via your favorite Package Manager:

winget install DiamTek.JVM
scoop install jvm
choco install jvm-windows

Or grab the standalone jvm-windows-1.0.0.msi installer from Releases.

🗑️ Uninstallation

Easily remove JVM and all associated configurations:

🚀 Features

Windows Directory Junctions (Symlinks) provide a massive speed and workflow improvement because they allow the script to instantly swap your Java version without ever needing Administrator privileges (UAC). By routing your User PATH to a single junction (%LOCALAPPDATA%\DiamTek\JVM\current), 99% of modern tools (Gradle, Maven, IDEs) can natively resolve the path entirely in the background.

However, some ultra-legacy enterprise Java applications or obscure classloaders perform strict canonical path resolution that can occasionally fail to traverse Windows Directory Junctions. To ensure 100% unbreakable compatibility for all workflows, we built a Dual-Architecture Core.

By navigating to the Settings menu, users can freely toggle between the two modes:

Mode Mechanism Privileges Required Legacy App Compatibility
Symlink Mode (Default) Dynamically updates a junction pointer in your User PATH. Standard User (UAC-Free) Extremely High (99%)
Registry Mode (Legacy) Hardcodes absolute paths directly into the Machine HKLM Registry. Administrator (Prompts UAC) 100% Unbreakable

[!WARNING] Architecture Conflicts: Windows evaluates Machine (HKLM) paths before User (HKCU) paths. If you use Registry Mode (which writes to the Machine level) and later switch back to Symlink Mode (which writes to the User level), the old Machine path would normally stubbornly override your new Symlink! To prevent this, toggling back to Symlink Mode inside the Settings Menu will now automatically scrub the legacy Machine pollution for you. (Note: If you manually bypass the menu using --legacy and --symlink CLI flags and experience an override, simply run jvm clear to wipe the slate).

You can even override your global setting dynamically on a per-command basis using the --symlink or --legacy CLI flags (e.g., jvm 21 --legacy).

⚡ Extreme Performance & Safety

Despite being nearly 100 KB in size, the jvm.bat engine is mathematically optimized to bypass the notorious bottlenecks and memory leaks of standard Windows Batch scripts:

đź“‹ Prerequisites

Requirement Specification Notes
OS Windows 10 or Windows 11 Full support for x64 and native ARM64 detection.
Privileges Standard User UAC is bypassed by default via the Symlink Architecture. Admin is only required for legacy Registry Mode.
Dependencies None Runs purely on native CMD and PowerShell. No WSL, Cygwin, or MSYS2 required.

📚 Documentation

For deep technical details, CI/CD automation, and advanced usage, refer to the official documentation:

Document Description
Usage Guide Semantic routing, .java-version isolation, BYO-JDK, and Ecosystem commands.
Architecture Technical deep-dive into Directory Junctions and PowerShell Native execution.
SDKMAN! Comparison Why this is the premier native alternative to SDKMAN! for Windows.
FAQ Common questions about UAC, global routing, and Windows Registry bridging.
Changelog Detailed chronological release history and bug fixes.

🛠️ Usage

  1. Launch jvm.bat to open the interactive menu, or run it from any terminal.
  2. Navigate to Settings (Global Command & Setup) to install the jvm global command.
  3. Once installed globally, you can use the following commands from anywhere:

⚡ Quick-Switching (CLI)

Instantly update your JAVA_HOME and system PATH without opening menus. If there are duplicates, you will be prompted to pick a vendor.

Command Action / Description
jvm 21 Switch to JDK 21 globally.
jvm 21 --session Switch locally for the current terminal only (requires PowerShell Profile hook).
jvm 21 --symlink Force switch using Symlink Mode (UAC-Free) for this command.
jvm 21 --legacy Force switch using Registry Mode (Requests UAC) for this command.
jvm 21 --vendor adoptium Override priority and explicitly switch to Adoptium’s JDK 21.
jvm latest Dynamically switch to the absolute highest installed JDK version.
jvm lts Dynamically switch to the highest installed LTS version.
jvm Silently parses .java-version and auto-switches locally (or opens UI if missing).
jvm --global Parses .java-version and forces the switch globally to your registry.

Note on .java-version: Your file can contain inline CLI flags (e.g., 21 --vendor adoptium --legacy). Make sure the version and flags are on a single line. Architecture flags (--legacy) only apply when using jvm --global.

📥 Installations

Command Action / Description
jvm install Opens the fully interactive Installation Wizard UI.
jvm install 21 Initiates the installation of JDK 21 (pauses to prompt for Vendor).
jvm install 21 --vendor oracle Bypasses all prompts to silently download and install Oracle JDK 21.
jvm install lts Prompts you to pick an LTS version (e.g., 17, 21), then prompts for Vendor.
jvm install lts --latest Locks onto the highest available LTS, but still pauses for Vendor prompt.
jvm install lts --latest --vendor oracle 100% automated headless installation of the newest Oracle LTS version.
jvm install 17 --vendor oracle -y Aggressively bypasses all safety warnings (caps, overwrites) for CI/CD automation.

📦 Ecosystem Build Tools (SDKMAN Parity)

JVM supports downloading, switching, and managing tools natively alongside Java. You can manage these via the command line or through the interactive Ecosystem Management sub-menu (Option 2 in the main UI).

Command Action / Description
jvm install maven latest Installs the absolute newest version of Maven directly from Apache.
jvm install gradle 8.9 Installs a specific version of Gradle.
jvm kotlin 2.0.20 Instantly switches your active KOTLIN_HOME (and PATH) to the specified version.
jvm list Lists Ecosystem tools and their currently [ACTIVE] versions at the bottom.
jvm uninstall groovy 4.0.23 Safely uninstalls the tool and cleanly scrubs its environment variables.

🔄 Updates & Uninstalls

Command Action / Description
jvm update Opens the dynamic, vendor-sorted Updater menu UI.
jvm update --all Silently patches all installed JDKs and Ecosystem Tools to their newest releases.
jvm update --all --vendor oracle Silently checks and automatically patches only your Oracle JDKs.
jvm uninstall Opens the dynamic, vendor-sorted Uninstaller menu UI.
jvm uninstall 21 Headless uninstallation for JDK 21. Pauses if multiple vendors exist.
jvm uninstall 21 --vendor oracle 100% headless uninstallation targeting Oracle (bypasses all prompts).

đź§ą Global Environment Management

Command Action / Description
jvm list Lists all installed JDKs (version, vendor, path), highlighting the [ACTIVE] one.
jvm env Displays the current JAVA_HOME environment variable path.
jvm clear Instantly wipes JAVA_HOME and purges Java from your PATH.
jvm link <path> [name] Manually links a custom JDK directory (e.g., jvm link C:\my-jdk jdk-custom).
jvm unlink <name> Removes a custom linked JDK.
jvm version Checks your current jvm.bat build number against GitHub for updates.
jvm self-update Automatically downloads and atomic-swaps the core script if an update exists.
jvm self-uninstall Launches the deep uninstaller with UAC elevation (full system wipe).
jvm help / --help / /? Displays the complete CLI command reference and flag overrides.
jvm <semantic-alias> Routes dynamically (e.g., jvm latest, jvm lts, jvm 21).

🎨 Interface Guide

The utility uses native ANSI terminal color formatting to protect system stability:

🛡️ Safety Defaults

To prevent catastrophic accidental deletions on local filesystems, all critical prompts obey standard developer conventions:

📜 Version History

đź“„ License

Copyright (c) 2026 DiamTek / Alexéy Shishkin.

This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). See the LICENSE file for details.

Note: Oracle JDK downloads triggered by this tool are subject to the Oracle No-Fee Terms and Conditions (NFTC).