[Home]   [TOC]

Study_Java_Mac  
Mac
Updated Mar 22, 2014 by jht5...@gmail.com

To set to JDK 6

export JAVA_HOME=$(/usr/libexec/java_home -v 1.6)

To set JDK 7

export JAVA_HOME=$(/usr/libexec/java_home -v 1.7)

To set JDK 8

export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)

alias setjdk16='export JAVA_HOME=$(/usr/libexec/java_home -v 1.6)'
alias setjdk17='export JAVA_HOME=$(/usr/libexec/java_home -v 1.7)'
alias setjdk18='export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)'

参考资料

[1]. https://coderwall.com/p/esa4sg