Stop editing JAVA_HOME
jfs (Java Fucking Sucks) is a Windows Java
version manager. Point it at JDKs you already have, then switch with one
command. Your actual JAVA_HOME environment variable stays
unchanged. Behind the scenes, a directory junction moves. No shims, no
shell hooks, no background service.
irm https://jfs.acdev.app/install.ps1 | iex
1. Install once The script puts
jfs.exe in
%LOCALAPPDATA%\jfs\bin, sets your user
JAVA_HOME to %LOCALAPPDATA%\jfs\current, and
adds that bin plus %JAVA_HOME%\bin to your
user PATH.
2. Register local JDKs jfs does not download Java.
jfs add 21 "C:\path\to\jdk" checks for
bin\java.exe and records the path.
3. Switch
jfs use 21 retargets the
current junction. New java processes follow
it. Open terminals do not need a hook.
Commands
| Command | What it does |
|---|---|
| jfs list | Show registered JDKs. The active one is marked with *. |
| jfs add <name> <path> | Register a local JDK directory. |
| jfs use <name> | Point the current junction at that JDK. |
| jfs current | Print the active version name. |
| jfs rm <name> | Forget a version. Files on disk stay. The active version cannot be removed. |
Where state lives
%LOCALAPPDATA%\jfs\ config.json registry of names and paths current NTFS junction to the active JDK bin\jfs.exe the program
jfs
GitHub