單位最近將jdk1.7切換成1.8,本地的開發(fā)環(huán)境(macos下)仍然是jdk1.7,現(xiàn)在想升級到j(luò)dk1.8 。
我在macos的“偏好設(shè)置”->java->更新1.8
但是我在終端使用
whereis java
顯示:
/usr/bin/java
再使用
java -version
仍然顯示 jdk1.7
請問應(yīng)該怎么升級/usr/bin/java 這里的java呢,或者怎么配置JAVA_HOME讓其指向系統(tǒng)的jdk1.8?
unix小白指教指教各位大俠~
閉關(guān)修行中......
macos的“偏好設(shè)置”->java->更新1.8
這樣更新的是本地的JRE
,并不是JDK
。JDK
You can only update it manually.
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
.
Remember, direct soft connection /usr/bin/java
命令到1.8版本的java,因為 /usr/bin/
下還有java其他命令,如 javac, javap
etc. is not allowed.