Configure JDK under Mac

1. Download JDK, for example JDK8U144

Download address https://pan.baidu.com/s/1upjecBzTIMnyz0JmdkYprQ

2. Installation

Configure JDK environment variables after installation

  • cd ~
  • open .bash_profile

Insert the following two sentences:

JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home
export JAVA_HOME=$JAVA_HOME

3. Test whether the configuration is successful

  • source .bash_profile
  • java -version (to see if the current JDK settings are in effect)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325121553&siteId=291194637