Guide
If you support old and new Java projects at the same time, the goal is not just switching versions — it is doing so predictably.
Keep each JDK installation as-is, assign a short alias to each one, and activate only one at a time. This prevents PATH clutter and makes it easy to move between Java 8, Java 11, Java 17, and Java 21 workflows.
Keep Java 8 or 11 available without letting them override newer projects accidentally.
Switch to Java 17 or 21 when needed without hand-editing environment variables every time.
Reduce accidental cross-project breakage by keeping the active JDK explicit and visible.