As usual, with major updates things break.
In this post we'll look at how to get homebrew and Java functioning properly.
JavaThe first thing you may notice is that any application you use, e.g., IntelliJ, that require Java does not work.
Let's fix that by updating Java for El Capitan.
Go Here and click the Download buttonJava for OS X 2015-001
After the javaforosx.dmg file is downloaded into your ~/Downloads folder, just double click it from the Finder and follow all the prompts to install it.
Update JavaNext, you'll want to go to your system preferences and update Java:
Now, you can verify it and see where El Capitan puts Java:
JenvIf you're like me and use jenv, you'll need to update that, too.
Note: jEnv is a command line tool to help you forget how to set the JAVA_HOME environment variable.
brew info jenv - ErrorIf you get an error like the following when attempting to run brew info...
$ brew info jenv jenv: stable 0.4.3 (bottled), HEAD Manage your Java environment http://www.jenv.be /usr/local/Cellar/jenv/20130917 (62 files, 260K) * Built from source From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/jenv.rb ==> Caveats To enable shims and autocompletion add to your profile: if which jenv > /dev/null; then eval "$(jenv init -)"; fi To use Homebrew's directories rather than ~/.jenv add to your profile: export JENV_ROOT=/usr/local/opt/jenv ~ $ brew update error: unable to unlink old '.travis.yml' (Permission denied) Error: Failure while executing: git pull --ff --no-rebase --quiet origin refs/heads/master:refs/remotes/origin/master
Fix Permissions... then you should fix the permissions in the /usr/local directory:
sudo chown $(whoami):admin /usr/local && sudo chown -R $(whoami):admin /usr/local
Note that the previous commands will fix a good number of other homebrew issues.
Update jenv shimYou'll want to update line 21 in $HOME/.jenv/shims/java
For me, I had to change this...
exec "/usr/local/Cellar/jenv/20130917/libexec/libexec/jenv" exec "$program" "$@"
exec "/usr/local/Cellar/jenv/0.4.3/libexec/libexec/jenv" exec "$program" "$@"
Set Global jEnv Java VersionIf you see this...
$ jenv versions jenv: version `oracle64-184.108.40.206' is not installed system oracle64-220.127.116.11 oracle64-18.104.22.168
... then, run this:
$ jenv global oracle64-22.214.171.124 $ jenv versions system oracle64-126.96.36.199 * oracle64-188.8.131.52 (set by /Users/lex/.jenv/version)
Check Java VersionFinally, you can verify that Java is now happy:
$ java -version java version "1.8.0_31" Java(TM) SE Runtime Environment (build 1.8.0_31-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)
BrewHomebrew needs some love, too.
Just keep running brew update and doing what it says until you see this:
$ brew update Already up-to-date.
Then, run brew doctor to be sure you're all good with brew:
$ brew doctor Your system is ready to brew.
ReferencesJava for OS X 2015-001 jEnv
This work is licensed under the Creative Commons Attribution 3.0 Unported License.