Removing Java 8 JDK from Mac Removing Java 8 JDK from Mac java java

Removing Java 8 JDK from Mac


I was able to unistall jdk 8 in mavericks successfully doing the following steps:

Run this command to just remove the JDK

sudo rm -rf /Library/Java/JavaVirtualMachines/jdk<version>.jdk

Run these commands if you want to remove plugins

sudo rm -rf /Library/PreferencePanes/JavaControlPanel.prefPanesudo rm -rf /Library/Internet\ Plug-Ins/JavaAppletPlugin.pluginsudo rm -rf /Library/LaunchAgents/com.oracle.java.Java-Updater.plistsudo rm -rf /Library/PrivilegedHelperTools/com.oracle.java.JavaUpdateHelpersudo rm -rf /Library/LaunchDaemons/com.oracle.java.Helper-Tool.plistsudo rm -rf /Library/Preferences/com.oracle.java.Helper-Tool.plist


You just need to use these commands

sudo rm -rf /Library/Java/*sudo rm -rf /Library/PreferencePanes/Java*sudo rm -rf /Library/Internet\ Plug-Ins/Java*


Managing Java versions on Mac OSX is a nightmare. I recently switched over to using JDK 1.7, deleting JDK 6 from my MacBook entirely (I also had traces of JDK 5 - this laptop has been updated a few times).

Here's what I did to move to JDK 7.

1) download the latest from Oracle (http://www.oracle.com/technetwork/java/javase/downloads/index.html) and install it.

2) Remove (using rm - if you've got backups, you can revert if you make a mistake) all the JDK6 and JRE6 files.

At this stage, you should see:

% ls /Library/Java/JavaVirtualMachines/jdk1.7.0_nn.jdk

(and nothing else)

3) In the folder /Library/Java/Extensions/, you'll need to remove all the old jar files, the ones that correspond to other releases of Java. If you don't, you'll get the infamous message about the wrong version of tools.jar (see Builds failing after upgrading to Java7, Missing Tools.jar and bad class versions). It is not enough to rename the jar files, because Java will open every jar in that folder - I moved mine into a sub-directory. It's safe to remove them once you know everything else works.

I haven't found I need to set JAVA_HOME for simple things.

Note: I just tried running IntelliJ and it will not start unless you have Apple's JDK 6 installed (see http://youtrack.jetbrains.com/issue/IDEA-93710). Same is true for Eclipse. Netbeans works fine.