MacOS 安装 JDK

2020-03-26  本文已影响0人  Hello泽泽

1.JDK下载

java 8 下载: https://www.oracle.com/java/technologies/javase-jdk8-downloads.html

image.png

2.安装

4.配置Java环境变量

jdk 安装目录
/Library/Java/JavaVirtualMachines/jdk1.8.0_241.jdk

$ vim ~/.bash_profile 
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/Home 
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar 
export PATH=$PATH:$JAVA_HOME/bin   

$ source ~/.bash_profile

5.版本

$ java -version                                                                                                                                                                   
java version "1.8.0_241"
Java(TM) SE Runtime Environment (build 1.8.0_241-b07)
Java HotSpot(TM) 64-Bit Server VM (build 25.241-b07, mixed mode)
上一篇下一篇

猜你喜欢

热点阅读