Java – Removing Java 8 JDK from Mac

intellij-ideajavajava-8macos

So I installed the beta of JDK 8 a while ago to look at some of the examples. I thought for sure by now, it's easy to change between versions.

Doing some Play development with IntelliJ. For some reason, IntelliJ is compiling with 8 even though:

  • I have the compiler set in Preferences to use 1.6
  • Supposedly it's using SBT through external build, but sbt from the command line works
  • JAVA_HOME is pointing to JDK 6.

If I go to the Java Preferences page, it does show 8 installed, but there is no option to uninstall it and it doesn't see any of the other versions.

When I do which java, it tells me /usr/bin/java and I do /usr/bin/java -version and it returns 1.6.

Note: with a little fiddling, you can use IntelliJ and JDK7, see here.

Best Answer

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.prefPane
sudo rm -rf /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
sudo rm -rf /Library/LaunchAgents/com.oracle.java.Java-Updater.plist
sudo rm -rf /Library/PrivilegedHelperTools/com.oracle.java.JavaUpdateHelper
sudo rm -rf /Library/LaunchDaemons/com.oracle.java.Helper-Tool.plist
sudo rm -rf /Library/Preferences/com.oracle.java.Helper-Tool.plist