![]() Now close the current shell and launch a new one and add installed java versions one by one. It is similar to pyenv in python or rbenv in ruby.Īdd to bash_profile $ echo 'export PATH="$HOME/.jenv/bin:$PATH"' > ~/.bash_profile $ echo 'eval "$(jenv init -)"' > ~/.bash_profile Now we can use jenv for managing multiple java versions. You can verify the install locations.įind locations of installed Java JDK: $ /usr/libexec/java_home -V Matching Java Virtual Machines (2): 11.0.2, x86_64: “OpenJDK 11.0.2” /Library/Java/JavaVirtualMachines/openjdk-11.0.2.jdk/Contents/Home 1.8.0_121, x86_64: “Java SE 8” /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home Managing versions Then you can install the version(s) you like: brew cask install java8 brew cask install java11 Then you can look at all the versions available: brew search java Once Homebrew is installed and you make Cask available by adding it as a tap brew tap caskroom/cask To install Homebrew run the following in a terminal, hit Enter, and follow the steps on the screen: /bin/bash -c "$(curl -fsSL )" You can also install it from the terminal by running the following: sudo xcode-select -install ![]() It include compilers and other tools that will allow you to build things from source. ![]() ![]() Installationīefore you can run homebrew you need to have the Command Line Tools for Xcode installed. In this article, we use homebrew and jenv for installing and managing multiple java versions. Installing and Managing Multiple Java versions on MacOS ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |