Switch Java Version - HHS-Team670/MustangLib GitHub Wiki
How to switch java version
- Install java from here https://jdk.java.net/archive/
- For Mac: download Arm 64 if you are using a M-series chip, otherwise download x64
- If your computer is currently on a version of java other than 17 follow the below steps
- This step does not apply if this is the first time downloading java
- open terminal
-
sudo mv downloads/jdk-<version>.jdk /Library/Java/JavaVirtualMachines/jdk-<version>.jdk
to move the java into the correct path
-
https://medium.com/@devkosal/switching-java-jdk-versions-on-macos-80bc868e686a
- use
/usr/libexec/java_home -V
to make sure that your java is in the correct place
touch .zshrc
nano .zshrc
- add:

and change 1.8 to 17.0.x
- Save, quit, check with
java -version
- if you get a malware popup go to privacy and settings in your settings and approve the jdk
- switch to open ~/.zshrc if it doesn't permanently set using open ~/.bash_profile
- https://www.happycoders.eu/java/how-to-switch-multiple-java-versions-windows/
⚠️ **GitHub.com Fallback** ⚠️