I installed java with homebrew, using the command brew cask install java.
After successfully installing, I typed which java, and the path showed to be /usr/bin/java
When I typed brew cask info java, this showed up:
java: 1.8.0_102-b14 Java Standard Edition Development Kit
/usr/local/Caskroom/java/1.8.0_102-b14 (227.5M) https://github.com/caskroom/homebrew-cask/blob/master/Casks/java.rb Contents JDK 8 Update 102.pkg (pkg) Caveats This Cask makes minor modifications to the JRE to prevent issues with packaged applications, as discussed here: If your Java application still asks for JRE installation, you might need to reboot or logout/login.
Installing this Cask means you have AGREED to the Oracle Binary Code License Agreement for Java SE at
Did I forget to link something?
which java
I also get/usr/bin/java
. So that’s not an indication of a problem./usr/bin/java
is just a symlink to/System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java
which I guess is some indirection thing that finds the right java binary. Anyway, what do you actually get if you runjava -version
? In my environment, even thoughwhich java
gives me/usr/bin/java
,java -version
gives mejava version "1.8.0_102" Java(TM) SE Runtime Environment (build 1.8.0_102-b14)
(the cask version) as expected. – sideshowbarkerjava
it’s using the version you installed from homebrew—and it means the fact thatwhich java
tells you/usr/bin/java
is not a problem (in fact that’s expected). In other words, you already have everything working as it should be, and there’s nothing more you need to do (e.g., you don’t need to link anything more). – sideshowbarker