Jvm For Mac Os
It’s pretty common when doing Java development to need mutiple versions installed alongside each other.With Brew and Jenv, switching Java versions between projects becomes easy.
To determine the current JRE version installed on your system, see Determining the JRE Version Installed on macOS. To install an earlier version of the JRE, you must first uninstall the current version. See Uninstalling the JRE on macOS. When you install the JRE, you can install only one JRE on your system at a. The last time this kind of thing bit me I was inadvertently installing the run-time Java (which is what Apple usually provides a link to) on my server, not the full Java SDK (which has the compilers and stuff you need to do developmentn).
First you need to tap the versions
cask:

Now you can see multiple versions of the Java cask:
Now we have the versions
cask, we can install our desired version of Java, e.g.:
At this point, you can not easily switch between the different Java versions, and the most recent Java version will be used.
Jenv allows you to manage the environment for multiple Java installs, and works well with Brew’s managed versions of Java.
To enable the Jenv shims and autocompletion:
Now restart your shell by either re-opening Terminal, or running the following:
Add your JVMs to Jenv as follows:
Jvm 1.7 Mac Os X

By default, Jenv will be using the system installed version of Java, which will be the latest one.

Jvm For Mac Os High Sierra
You can override this globally by running:
Java For Mac Os
or if you just want to affect a particular project:
Java For Macos 2017-001 Can T Be Installed
If you’re using Maven on the CLI, you will want to enable the Maven shim, otherwise it will still be using the system version of Java:
Mac Os Java Runtime
See the Jenv site for more details.
