Uninstalling Java for OS X

Wouldn’t you know it, I install Oracle Java SE 7 for my Mac just days before a serious exploit is found in this newest version of Java. If you’re like me, it’s easier to just uninstall Java until Oracle has a chance to fix exploit. Here’s how:

Using the Terminal application (/Applications/Utilities/Terminal) enter the following commands one at a time:


sudo rm -rf /System/Library/Java/JavaVirtualMachines/*.jdk
sudo rm -rf /Library/Java/JavaVirtualMachines/*.jdk
sudo rm -rf /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
sudo rm -rf /Library/PreferencePanes/JavaControlPanel.prefpane

The first one should request an Administrator password, but the rest should run without it. You may encounter a “No such file or directory” error with some of these commands… no worries then, you just didn’t have that component installed.

Since I need a version of Java installed for development purposes and to use Photoshop CS4 (??), I went ahead and re-installed Apple’s supported version of Java SE 6. Java for OS X 2012-004 sounds like it requires a previous install of Java, but it seems to work fine with Mountain Lion (OS X 10.8.1) and no existing SE 6 install.