Switch between multiple versions of Java on Mac

I'll forget it soon, so it's a memorandum for myself.


Put the following in .bashrc.

~/.bashrc


export JAVA_HOME=`/usr/libexec/java_home -v "1.8"`
export PATH=$JAVA_HOME:$PATH

To make Java 9 /usr/libexec/java_home -v "9"

Recommended Posts

Switch between multiple versions of Java on Mac
Using multiple versions of Java with Brew on Mac + jEnv
How to switch Java versions on Mac
How to switch between multiple Java versions
Manage multiple versions of Ruby on Mac [macOS + rbenv]
Install Java on Mac
Install and switch between multiple Javas on Ubuntu
Roughly switch between Ruby versions of Windows using junctions
How to switch Java in the OpenJDK era on Mac
Install Java development environment on Mac
How to switch Java version with direnv in terminal on Mac
How to check Java installed on Mac
Upgrade and switch Ruby versions on Windows 10
Java development environment construction memo on Mac
Build a Java development environment on Mac
Hello World on Mac VS Code Java
Looking back on the basics of Java
Memory measurement of Java application on Windows
Uncertainty of common Jar for multiple versions
Open multiple workspaces in Eclipse on Mac
Switch between GUI and CUI on CentOS6.
Basics of java basics ② ~ if statement and switch statement ~
Java installation (Mac, Homebrew, multiple version control)
Install java and android-sdk on Mac using homebrew
Summary of Java environment settings for myself [mac]
I touched on the new features of Java 15
Switch versions with alternatives after yum install java
I tried running Java on a Mac terminal
Learn the meaning of "passing the PATH" by building a Java development environment on Mac
[Java] Overview of Java
Java switch statement
Create a Java development environment using jenv on Mac
Build Java development environment with VS Code on Mac
Install java and maven using brew on new mac