Skip to content

How to install and uninstall jdk on mac

zhanghui edited this page Apr 16, 2017 · 2 revisions

JDK indstall

Install JDK jdk installation

If there more jdk1.6, 1.7 or 1.8, if you want to set the jdk 1.8 version as JAVA_HOME, you can update the .profile file with

export JAVA_HOME="$(/usr/libexec/java_home -v 1.8)"

JDK uninstall

ref orical unstall jdk

remove system info

sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin 
sudo rm -fr /Library/PreferencePanes/JavaControlPanel.prefPane 
sudo rm -fr ~/Library/Application\ Support/Java

Do not attempt to uninstall Java by removing the Java tools from /usr/bin. This directory is part of the system software and any changes will be reset by Apple the next time you perform an update of the OS.

remove jdk files

optional, you can remove the useless java version. under "/Library/Java/JavaVirtualMachines" remove jdk folders

    rm -rf jdk1.8.*