Mac / Linux Terminal Switch between or change your Java Version for a session.

Steps:

  1. We need to install Java 8 via the Terminal. Therefore open the terminal. Execute the following command:
brew install cask adoptopenjdk8
/usr/libexec/java_home -V
export JAVA_HOME=`/usr/libexec/java_home -v 1.8.0_292`
java -version

Conclusion

You only need a few commands to set your java version.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Walter-Tscharf-Development

Walter-Tscharf-Development

If you like my work or have question contact me.