Removing Java from OS X Lion
Solution 1
I followed the instructions followed in this blog and they worked for me.
The steps are as follows:
- Check for Java Installation:
sudo /usr/libexec/java_home -xml
(an output with two JVM dictionaries confirms that Java is installed) - Run uninstaller:
sudo /usr/libexec/java_home –uninstall
- Remove JVM installation location:
sudo rm -rf /System/Library/Java
- 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.
Related videos on Youtube
Lukich
Updated on September 18, 2022Comments
-
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 almost 13 yearsDo you know of a hypervisor (like VMware Fusion or Parallels Desktop) that will run Lion?
-
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 about 12 yearsUnfortunately, this process doesn't appear to work after the 2012-04-05 update. There is no
-uninstall
argument to thejava_home
binary. -
Sasha about 12 yearsWorks for me on 10.7.4.