I am looking to install Java on Mac using Homebrew
. This works fine using the command brew cask install java
.This installs the latest stable version which is currently - 1.8.0_141
However how can I install a specific version for example 1.8.0_131
.
I just tried again, it's working fine, please follow the steps, you need to run "brew tap caskroom/versions" first. As instructed by homebrew, the command that worked for me was brew cask install caskroom/versions/java8 First I ran brew cask uninstall java to remove the other version I had previously installed.
We use the export command with the variable name next to it and then specify the location of usr/libexec/java_home with the argument -v and the version we want to change to 1.8. Note that backticks are being used around the path. Check the Java version again to confirm that the version was changed.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew update
brew tap homebrew/cask-versions
brew search java
Optional: to find out the minor version of java
brew info --cask java8
brew install --cask java8
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With