1

I am trying to remove JDK and JRE from my mac to revert back to an older version. I tried removing jdk folder from System/Library/Java/VirtualMachines as described here and i al so removed the Java applet as described here but i can still see java installed on my mac. Typing java -version gives me the following output:

        Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
        Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

Typing ls -l /usr/bin/java gives the following output -

/usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java

I can see a lot of folders at this location and i don't really know which one to delete to uninstall Java completely and install an older version.

Sayed Jalil Hassan
  • 2,535
  • 7
  • 30
  • 42

1 Answers1

0

The Java 7 JDK is under /Library, not /System/Library.

Only Apple software is allowed to use /System, Java 7 and later are supplied by Oracle, so install under /Library/Java/JavaVirtualMachines. Deleting the appropriate JDK directory from there should be enough to complete the un-installation. In particular you should not touch anything under /System/Library/Frameworks, the stuff in there is either for backwards compatibility with apps that expect the old Apple Java installation paths from Java 5 and earlier, or for the stub mechanism that makes /usr/bin/java work (and delegate to whichever real JDK is the current target of JAVA_HOME).

Ian Roberts
  • 120,891
  • 16
  • 170
  • 183
  • Thanks. I figured that out. but i have already deleted the System JDK. Can i restore it ? – Sayed Jalil Hassan Feb 22 '15 at 12:13
  • 1
    @sayed if it's just the `/System/Library/Java/JavaVirtualMachines` one you mean (i.e. the Apple Java 6 JDK) then you should be able to re-install that from the latest ["Java for OS X" package from apple](http://support.apple.com/kb/DL1572) – Ian Roberts Feb 22 '15 at 12:18
  • 1
    For reference, find the official guide to uninstalling Java for Mac OSX on the Oracle Website. **Java 7**: http://docs.oracle.com/javase/7/docs/webnotes/install/mac/mac-jdk.html#uninstall **Java 8**: http://docs.oracle.com/javase/8/docs/technotes/guides/install/mac_jdk.html#A1096903 – Chris2M Mar 07 '16 at 14:00