Removing Java from OS X Lion

15,301

Solution 1

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.

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

Solution 3

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:
15,301

Related videos on Youtube

Lukich
Author by

Lukich

Updated on September 18, 2022

Comments

  • Lukich
    Lukich almost 2 years

    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?

  • William Jackson
    William Jackson almost 13 years
    Do you know of a hypervisor (like VMware Fusion or Parallels Desktop) that will run Lion?
  • KeithB
    KeithB almost 13 years
    @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.
  • Sean
    Sean about 12 years
    Unfortunately, this process doesn't appear to work after the 2012-04-05 update. There is no -uninstall argument to the java_home binary.
  • Sasha
    Sasha about 12 years
    Works for me on 10.7.4.