
Open a terminal window, and type which java to see all locations pointing to the java program - it gives you some clues about where the JDK installation directory is. Uninstall OpenJDK on macOSIf you have OpenJDK installation, it’s very likely that it was extracted from an archive file to a specific directory.

Sudo rm -rf /Library/PreferencePanes/JavaControlPanel.prefpane Then you’re all done.Ģ. Sudo rm -rf /Library/Internet\ Plug-Ins/ugin Sudo rm -rf jdk-versionThis command will be executed under root privilege (password required) - the specified JDK directory will be deleted recursively and forcefully.If you uninstall JDK 1.8, you also need to remove 2 other directories using the following commands: Then type the following command to remove a JDK installation completely from macOS: To install Homebrew enter the following command in terminal. Open a terminal window, change the current directory:Ĭd /Library/Java/JavaVirtualMachinesThen type ls command to see the installed JDK directories. You need to install either Homebrew or YUM. Uninstall Oracle JDK on macOSIf you have a JDK installation that was installed by Oracle JDK installer, you need to find the JDK directory in the /Library/Java/JavaVirtualMachines path. In this quick post, I’d like to share with you how to uninstall JDK entirely from macOS operating system. When a JDK installation is no longer used, it should be completely removed from the computer.
