7

I tried searching for hours trying to figure out how to uninstall Java 7 JDK on my Mac since it kept crashing both Eclipse and some Minecraft mod packs. I tried to restore back to Java 6 JDK instead which is provided by Apple. I tried looking at Oracle's site to try to find out how to fix the problem. If you scroll down to the bottom of the page you'll see where it tells you do uninstall using sudo. I can't find the Java folder inside of Library, I try using the Go To Folder function too in Finder but it seems I cannot find it. I've also tried through Terminal and still cannot find the folder. It seems that no one else has had this problem before.. I've asked on forum sites and cannot find an answer. Please respond as quick as possible!

http://docs.oracle.com/javase/7/docs/webnotes/install/mac/mac-jdk.html

user2644292
  • 71
  • 1
  • 1
  • 2
  • 1
    I think [this](http://stackoverflow.com/questions/19039752/removing-java-8-from-mac#answer-23092014) might help. – shyan1 Oct 22 '14 at 00:16
  • @yanshuai thanks, the SO question you pointed to worked for me. I'm going to use `Homebrew` with `Jenv` to manage my installed Java versions, seems way cleaner & easier. http://hanxue-it.blogspot.ch/2014/05/installing-java-8-managing-multiple.html – Adriano Mar 22 '15 at 12:37

3 Answers3

14

You can look inside:

/Library/Java/JavaVirtualMachines

If there is a folder of jdk.1.7 or similar, you can delete it. Restart your programs and they will get Java 1.6 as a default.

Anastasios Andronidis
  • 6,310
  • 4
  • 30
  • 53
5

If you can't find the Java Home, open up terminal and enter:

env

look for or SOMETHING LIKE THIS Mine might not be the same as yours

JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.7/Home

This is where your Java is installed

If you want to see it in Finder then open up Finder and press Command + Shift + G and enter in the path to java home.

to uninstall simply remove the java version from :

/System/Library/Java/JavaVirtualMachines

with

cd /System/Library/Java/JavaVirtualMachines
rm -r some.version.java.jdk

Note: Sometimes Java is install in /System/Library but sometimes it's installed on /Library, so that's why you couldn't find Java in /Library which the Oracle document suggested.

Louis Hong
  • 1,051
  • 2
  • 12
  • 27
  • Unfortunately I cannot find anything related to Java when I type in env in terminal. – user2644292 Aug 02 '13 at 03:46
  • 1
    @user2644292 Then you DO NOT have JDK installed, you have Java JRE 7 installed. these aren't the same things. follow this tutorial to uninstall Java 7.http://www.java.com/en/download/help/mac_uninstall_java.xml (I'm not sure if you know, JDK stands for Java Development Kit. What you might be trying to say is Java JRE 7, which is Java Runtime Environment. Minecraft does not need JDK to play. You mentioned eclipse, how would you use eclipse if you don't even have JAVA_HOME set? This is a obvious problem) – Louis Hong Aug 02 '13 at 06:15
  • You see I've already deleted the Java JRE 7.. and I DO have the JDK installed. I installed it but I can't find the directory. I still have the .dmg sitting in my Downloads. – user2644292 Aug 02 '13 at 21:27
  • Try these for some luck, I bet your computer is using the Internal JRE. "java -version" (For checking JRE version) and "javac -version" (For checking JDK version (Which shouldn't work without JAVA_HOME)) – Louis Hong Aug 03 '13 at 15:25
  • 1
    Another trick for Finding Java is opening Finder, press SHIFT+COMMAND+G and then typing in /usr/bin and hit enter. If should bring you to a lot of files, look for java or javac, once you find them right click and click show original – Louis Hong Aug 03 '13 at 15:28
  • Thank you, i found java and javac using the SHIFT+COMMAND+G route. I found them under the Commands directory.. should i delete them now? I also did the javac -version and it displayed this version number: 1.7.0_25 which means I am in Java 7 Update 25. – user2644292 Aug 03 '13 at 19:57
  • Um.... go to the original directory and delete everything under the root directory of the SDK version. That should do – Louis Hong Aug 04 '13 at 15:36
  • 2
    +1 for "Sometimes Java is install in /System/Library but sometimes it's installed on /Library", saved my day – Display Name Oct 25 '13 at 14:51
1

in my current case: sudo rm -rf /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk

tangrammer
  • 3,041
  • 17
  • 24