单位最近将jdk1.7切换成1.8,本地的开发环境(macos下)仍然是jdk1.7,现在想升级到jdk1.8 。我在macos的“偏好设置”->java->更新1.8但是我在终端使用
whereis java
显示:
/usr/bin/java
再使用
java -version
仍然显示 jdk1.7请问应该怎么升级/usr/bin/java 这里的java呢,或者怎么配置JAVA_HOME让其指向系统的jdk1.8?unix小白指教指教各位大侠~
闭关修行中......
macos的“偏好设置”->java->更新1.8这样更新的是本地的JRE,并不是JDK。JDKYou can only update it manually.
macos的“偏好设置”->java->更新1.8
JRE
JDK
Execute
ls -la /usr/bin/java
You will get the real storage location of the java command,
lrwxr-xr-x 1 root wheel 74B 3 18 2016 /usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java
Softly connect the installed version 1.8 directory to the directory/System/Library/Frameworks/JavaVM.framework/Versions/Current.
/System/Library/Frameworks/JavaVM.framework/Versions/Current
Remember, direct soft connection /usr/bin/java 命令到1.8版本的java,因为 /usr/bin/ 下还有java其他命令,如 javac, javapetc. is not allowed.
/usr/bin/
javac, javap
I keep making a mistake, just download jdk1.8.
macos的“偏好设置”->java->更新1.8
这样更新的是本地的JRE
,并不是JDK
。JDK
You can only update it manually.Execute
You will get the real storage location of the java command,
Softly connect the installed version 1.8 directory to the directory
/System/Library/Frameworks/JavaVM.framework/Versions/Current
.Remember, direct soft connection
/usr/bin/java
命令到1.8版本的java,因为/usr/bin/
下还有java其他命令,如javac, javap
etc. is not allowed.I keep making a mistake, just download jdk1.8.