How to *Completely* Uninstall Java from your Mac

This link gives details on how to uninstall Java. The first bit is definitely necessary (snippet added below so you don’t have to visit another link):

Uninstall Oracle Java using the Terminal

Note: To uninstall Java, you must have Administrator privileges and execute the remove command either as root or by using the sudo.

Remove one directory and one file (a symlink), as follows:

  1. Click on the Finder icon located in your dock
  2. Click on the Utilities folder
  3. Double-click on the Terminal icon
  4. In the Terminal window Copy and Paste the command below:
    sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
    sudo rm -fr /Library/PreferencePanes/JavaControlPanel.prefpane

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.

While these steps definitely help, they don’t completely uninstall Java, especially if you have multiple versions on your system that you didn’t know about (this was my predicament).

Going back to Terminal, type the following:

cd /Library/Java/JavaVirtualMachines

The first line is a “change directory” command. The next line is a “list” files and directories command. What you might see is this:

cd /Library/Java/JavaVirtualMachines

1.6.0.jdk is the old version that’s still sitting on my computer after going through Java/Oracle’s instructions for removing Java. This last bit is fairly simple. In the Terminal, type this:

sudo rm -rf 1.6.0.jdk

If you don’t have the same version I do, you can type sudo rm -rf, then type a space and the first number of the version you see sitting in that directory. Then, hit the tab button immediately after, and the full name of the item should automatically populate. Then, hit Enter. If you haven’t entered your admin password in a while, you may be asked to enter it again here.

I recommend a restart after you’ve uninstalled.

If you have any questions about this process, feel free to post your comments below. Thanks!

By Sharon

Hello there! I'm a web developer in Louisville, Kentucky. I started on this career path by purchasing an O’Reilly PHP book from Barnes & Noble in 1999. Since then, my desire to learn as much as I can about web site building and server maintenance has grown. I love technology and what it can do to simplify our lives and make it more interesting all at the same time. Seeing a creative design come to life and bringing it into the web world is my favorite puzzle to solve. My server experience is based around launching WordPress-friendly servers — Linux (Ubuntu and Centos flavors), Apache, MySQL, and PHP. I have worked with various modules, extensions, installs such as ImageMagick, LetsEncrypt, Sass, LESS, and the Homebrew family of extension. My main love has been with PHP, and my CMS of choice has been WordPress since its inception in 2003. I find it flexible, secure, easy to design around, and so customizable. My strengths are in developing from-scratch plugins and themes for the WordPress CMS with a strong background in PHP and MySQL development.

Leave a comment

Your email address will not be published. Required fields are marked *