Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

migrated from stackoverflow.com Jul 27 '11 at 17:06

This question came from our site for professional and enthusiast programmers.

add comment

5 Answers

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.
share|improve this answer
1  
Unfortunately, this process doesn't appear to work after the 2012-04-05 update. There is no -uninstall argument to the java_home binary. –  Sean Apr 5 '12 at 18:24
    
Works for me on 10.7.4. –  Josh Brown May 24 '12 at 12:29
add comment

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.

share|improve this answer
    
Do you know of a hypervisor (like VMware Fusion or Parallels Desktop) that will run Lion? –  William Jackson Jul 27 '11 at 19:20
    
@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 Jul 27 '11 at 20:01
    
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 Jul 28 '11 at 18:37
add comment

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.

share|improve this answer
add comment

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".

share|improve this answer
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.