We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mac自带了的JDK6,安装在目录:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/下。
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/
JDK7,JDK8则需要自己到Oracle官网下载安装对应的版本。自己安装的JDK默认路径为:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk
/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk
export JAVA_6_HOME=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home export JAVA_7_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0.jdk/Contents/Home export JAVA_8_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home export JAVA_HOME=$JAVA_7_HOME
JAVA_HOME
alias jdk8='export JAVA_HOME=$JAVA_8_HOME' alias jdk7='export JAVA_HOME=$JAVA_7_HOME' alias jdk6='export JAVA_HOME=$JAVA_6_HOME'
CNxnliu:Versions xnliu$ java -version java version "1.6.0_65" Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609) Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode) CNxnliu:Versions xnliu$ jdk8 CNxnliu:Versions xnliu$ java -version java version "1.8.0" Java(TM) SE Runtime Environment (build 1.8.0-b132) Java HotSpot(TM) 64-Bit Server VM (build 25.0-b70, mixed mode) CNxnliu:Versions xnliu$
或使用http://www.jenv.be/
原文链接
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Mac下同时安装多个版本的JDK
Mac自带了的JDK6,安装在目录:
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/
下。JDK7,JDK8则需要自己到Oracle官网下载安装对应的版本。自己安装的JDK默认路径为:
/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk
1. 在用户目录下的bash配置文件.bashrc中配置JAVA_HOME的路径:
2. 创建alias命令动态切换
JAVA_HOME
的配置3. 验证
或使用http://www.jenv.be/
原文链接
The text was updated successfully, but these errors were encountered: