This article mainly introduces the relevant information on installing java and configuring environment variables on MAC system. Friends in need can refer to
MAC Configuring java environment variables
1. List all Java version information
/usr/libexec/java_home -V
2. Modify the .bash_profile file
cd ~ touch .bash_profile vi .bash_profile
3. Configure the JDK environment variable content and enter wq to save
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home #jdk安装路径 export PATH=$JAVA_HOME/bin:$PATH export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
source .bash_profile
5. Check the environment variable JDK version
java -version
The above is the detailed content of Detailed explanation of installing Java and configuring environment variables on MAC system. For more information, please follow other related articles on the PHP Chinese website!