Actually, the fastest and right way is to install Java 7 and manage versions of Java via "homebrew". However, I don't know why, Oracle put Java 7 installer under the authentication. It needs username and password. Because of this, related installer cannot be found on homebrew repos.
Not the fastest way, but there is only one way left, MANUEL SETUP.
1) Uninstall jdk8:
sudo rm -rf /Library/Java/*
sudo rm -rf /Library/PreferencePanes/Java*
sudo rm -rf /Library/Internet\ Plug-Ins/Java*
2) Install jdk7:
You must have oracle account. Enter your username & password on Oracle Java 7 download page and download/install it.
3) Reinstall jdk8:
You don't need oracle account for this.
4) Prepare environment variables:
Add something below into .profile(.bash_profile) file on your home directory.
export JAVA_8_HOME=$(/usr/libexec/java_home -v1.8)
export JAVA_7_HOME=$(/usr/libexec/java_home -v1.7)
alias java7='export JAVA_HOME=$JAVA_7_HOME'
alias java8='export JAVA_HOME=$JAVA_8_HOME'
#default java8
export JAVA_HOME=$JAVA_8_HOME
5) Check the version of your java installed on your Mac.
References:
- https://stackoverflow.com/a/26252993
- https://github.com/caskroom/homebrew-cask/issues/9447
- https://stackoverflow.com/a/30412014
Hiç yorum yok:
Yorum Gönder