Table of Contents
Check current version
View all versions on machine
Download a new version of Java
Check JAVA_HOME
Update JAVA_HOME
Step one
Step two
Check current version
View all versions on machine
Download a new version of Java
Check JAVA_HOME
Update JAVA_HOME
Step one
// Example
export JAVA_HOME=`/usr/libexec/java_home -v 20.0.02`
Step two
/**
* If you don’t already have JAVA_HOME defined, add it
* to this file with the path to your desired version of
* Java. Example below:
**/
export JAVA_HOME=”/Library/Java/JavaVirtualMachines/jdk-20.jdk/Contents/Home”
Save your changes
CTRL + O (Not zero)
ENTER
CTRL + X
Confirm
nano ~/.zshrc
// Confirm Java version
java –version
Thank you for reading 🙏🏽 I hope this was helpful. ☺️