mac安装和卸载jdk

mac卸载jdk

列出JDK

ls /Library/Java/JavaVirtualMachines/

移除JDK

sudo rm -rf /Library/Java/JavaVirtualMachines/1.6.0.jdk

配置Java环境变量

vim .bash_profile

export JAVA_8_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home 

export JAVA_HOME=$JAVA_8_HOME

export PATH=$JAVA_HOME/bin:$PATH:. 

export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar 

export JMETER_HOME=/Users/ashleyyin/Downloads/apache-jmeter-5.1.1 

export PATH=$JAVA_HOME/bin:$PATH:.:$JMETER_HOME/bin:$PATH 

export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JMETER_HOME/lib/ext/ApacheJMeter_core.jar:$JMETER_HOME/lib/jorphan.jar:$JMETER_HOME/lib/logkit-2.0.jar

Mac查找JDK路径

1、打开控制台,输入以下命令

$ /usr/libexec/java_home -v

你可能感兴趣的:(mac安装和卸载jdk)