Skip to content

Instantly share code, notes, and snippets.

@negamorgan
Created September 22, 2014 20:28
Show Gist options
  • Save negamorgan/d3101a4a39b4c8661cd7 to your computer and use it in GitHub Desktop.
Save negamorgan/d3101a4a39b4c8661cd7 to your computer and use it in GitHub Desktop.
Java 7 Dev Environment set up (OS X)
  1. Download JDK 7 for OS X x64 and follow the installation wizard.

  2. Add JAVA_HOME to env variables in .bash_profile, .bashrc or .zshrc

     export JAVA_HOME='/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home'
    
  3. Add java_home alias to .bash_profile, .bashrc or .zshrc

     alias java_home='/usr/libexec/java_home'
    
  4. Confirm java_home is working from Terminal

     > java -version
     java version "1.7.0_67"
     Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
     Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
     
     > java_home
     /Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment