JDK and Maven installation

Go to the official website to download the required JDK and follow the instructions to install it. Maven downloads it and unzips it to the desired path.

Environment variable setting

This is slightly different from Windows Settings. In Windows environment, the JAVA_HOME configuration path is the JDK installation path. On Mac side, you need to use /usr/libexec/JAVA_HOME command to view the path. To do this, open the Mac console, type the Open-e-bash_profile command to create a configuration file for editing, and then enter the following information:

JAVA_HOME = $(/ usr/libexec/JAVA_HOME) MAVEN_HOME = / Users/guomingzhe/devTools/apache maven -- 3.8.1 PATH=$JAVA_HOME/bin:$MAVEN_HOME/bin:$PATH CLASSPATH=$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar export JAVA_HOME export PATH export CLASSPATH export MAVEN_HOME export PATH

The configuration of JAVA_HOME needs to be careful not to write wrong, and the Maven path is the unzip path.

validation

Verify that the above two are configured correctly using java-version, mvn-v, and echo $JAVA_HOME.