Please note that on older versions of MacOS following command will revsied as “ brew cask install adoptopenjdk8“. We will activate AdoptOpenJDK tap to install specific version of Open JDK, to do this from terminal run following command. PATH : /usr/local/Cellar/jenv/0.5.4/libexec/libexec:/Users/u1/.jenv/shims:/Users/sma/.jenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin Please check your path, or try using /path/to/java/home is not a valid path to java installation. Java binary in path is not in the jenv shims. Successful installation will produce output like following. Verify the installation of jEnv by running following command. Now either restart the Terminal or type following command to reload the shell configurations. sudo nano ~/.zshrcĪdd following entries in ~/.zshrc file, save and exit the editor using Ctrl O then ENTER and Ctrl X then ENTER key combination. If you look at the output from last section it actually has the reference to the target shell configuration file i,e. Location and name of the shell configuration may vary depending on the currently active shell on your Mac. Now we have jEnv installed on our machine and will add following entries to shell configuration. To activate jenv, add the following to your ~/.profile: ![]() ![]() Output of successful installation will be as following. Open a terminal window and run following command to install jEnv on your Mac machine. JEnv, a well known Java Version Manager is a command line tool to manage multiple versions of java on your machine, behind the scenes it uses JAVA_HOME environment variable to do this. We will make use of Homebrew Cask (homebrew package to install GUI based applications), cask package is included by default in latest versions of homebew so we not need to install it separately. Sudo rm -rf /Library/Internet\ Plug-Ins/Java* ![]() Sudo rm -rf /Library/PreferencePanes/Java* If you have any existing version of java installed on your machine, open terminal run following commands on you Mac. bin/bash -c "$(curl -fsSL )" Optional: Remove Existing Java We will use Homebrew (the package manager for MacOS) to install the required softwares, open a terminal and run following command to install homebrew on your Mac. For this purpose, we will use a well known Java Version Manager software called jEnv.Ĭommercial: Oracle Binary Code License Agreement In this article we will explorer how to install and manage multiple Java version on MacOS.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |