Press "Enter" to skip to content

MacOS安装Java及配置

安装Java JDK

官网下载,并安装

环境变量的配置

vim ~/.bash_profile
  • 添加内容:
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-11.0.3.jdk/Contents/Home
export PATH=JAVA_HOME/bin:PATH:.

tar包安装,JAVA_HOME为解压位置

  • 保存修改:
source ~/.bash_profile

测试

javac -version
java -version
Leave a Reply

Your email address will not be published. Required fields are marked *