Removing Java from OS X Lion

11

1

OS X Lion ships without Java now. Installing it is not very difficult - however, our product relies on Java so we need to test the scenario of not having Java installed.

Once I've installed Java, is there any way to uninstall it from Lion?

Lukich

Posted 2011-07-27T17:01:28.777

Reputation: 211

Answers

6

I followed the instructions followed in this blog and they worked for me.

The steps are as follows:

  1. Check for Java Installation: sudo /usr/libexec/java_home -xml (an output with two JVM dictionaries confirms that Java is installed)
  2. Run uninstaller: sudo /usr/libexec/java_home –uninstall
  3. Remove JVM installation location: sudo rm -rf /System/Library/Java
  4. Run command from step 1 again. If you receive an output starting with "Unable to find any JVMs matching version", this confirms that Java is no longer installed.

Thorsten Lorenz

Posted 2011-07-27T17:01:28.777

Reputation: 161

2Unfortunately, this process doesn't appear to work after the 2012-04-05 update. There is no -uninstall argument to the java_home binary. – Sean – 2012-04-05T18:24:11.717

Works for me on 10.7.4. – Josh Brown – 2012-05-24T12:29:21.267

2

I don't know about uninstalling Java, but since Lion now permits virtualization another option is just to run another instance of Lion in a VM and don't install Java on it. This can also be used to test other configurations that you might run into.

KeithB

Posted 2011-07-27T17:01:28.777

Reputation: 8 506

Do you know of a hypervisor (like VMware Fusion or Parallels Desktop) that will run Lion? – William Jackson – 2011-07-27T19:20:37.217

@William: Looking into it, it appears that it is now allowed by Apple, and both VMWare and Parallels are working on adding it. BUt as of now, neither support doing it. – KeithB – 2011-07-27T20:01:38.540

Thank you, guys! I didn't know about the virtualization on Lion. Sounds like a good solution, now just have to wait until emulators start supporting it. – Lukich – 2011-07-28T18:37:24.950

2

You could always just make a clean install of Lion for test purposes, either on an extra partition or in virtualization.

You could also use the Java .pkg file to obtain a list of installed files.

NReilingh

Posted 2011-07-27T17:01:28.777

Reputation: 5 539

0

A procedure for uninstalling Java in Leopard is outlined in
How do you uninstall and then reinstall java on Mac OS X? :

There is no Java uninstaller that I am aware of.

Use Spotlight to find Java files, including receipts. You will have to be an expert surgeon because quite a lot of what you find may have come from third-party installers. (Do you really want to mess up several different applications?)
Trash the items that you are sure are only related to the Java VM.
Rename or remove: /System/Library/Frameworks/JavaVM.framework.

Boot to the Leopard install DVD. Choose custom install, select only "Essential System Software". After it finishes and restarts, use Software Update for a few update-restart cycles until it shows "is up-to-date".

harrymc

Posted 2011-07-27T17:01:28.777

Reputation: 306 093

0

The -uninstall option does not work anymore, it is not present. To remove java on my Mac I checked ... http://www.java.com/en/download/help/mac_uninstall_java.xml

I could not find Java through the user interface so I suggest to use the command lines option

Note: To uninstall Java 7, you must have Administrator privileges and execute the remove command either as root or by using the sudo.

1 - Click on the Finder icon located in your dock 2 - Click on Applications tab on sidebar 3 - Click on the Utilities folder 4 - Double-click on the Terminal icon 5 - In the Terminal window Copy and Paste the command below: sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin

Bizmate

Posted 2011-07-27T17:01:28.777

Reputation: 126