
Check your version jenv versionsįor setting system wide java version jenv global 14. Jenv add /Library/Java/JavaVirtualMachines/openjdk-14.0.1.jdk/Contents/HomeĪll done. You will get the output something like Jenv is correctly loadedįor installing java 8 brew cask install AdoptOpenJDK/openjdk/adoptopenjdk8įor installing java 11 brew cask install AdoptOpenJDK/openjdk/adoptopenjdk11įor list down all the java on your machine /usr/libexec/java_home -V Restart the terminal or use source ~/.zshrcĬheck if your JEnv is correctly installed jenv doctor Add these two lines in your bash profile file export PATH="$HOME/.jenv/bin:$PATH" JRE Version Command Line on Mac Type the following in a Terminal window: /Library/Internet Plug-Ins/ugin/Contents/Home/bin/java -version Determining the Default Version of the JDK on Mac When launching a Java application through the command line, the system uses the default JDK.

Installing JEnv - java version manager a cool tool helps you to switch between multiple java env on your mac brew install jenvĪdding jEnv to your path depends on the shell you are using ~/.bash_profile or ~/.bashrc, for zsh it's ~/.zshrc. If you have already had homebrew (a package installer in mac), you can skip this step.įor installing or updating homebrew /bin/bash -c "$(curl -fsSL )"

In mac it's pretty simple you can have two or many java versions and based on your requirement you can change that.
