tavoyne
tavoyne

Reputation: 6539

Unable to uninstall java

I tried to uninstall Java on my MAC OS Mojave (10.14) by running these commands (as it is recommended in the documentation):

sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin 
sudo rm -fr /Library/PreferencePanes/JavaControlPanel.prefPane 
sudo rm -fr ~/Library/Application\ Support/Oracle/Java

But when I run the java -version command on my terminal, I still get:

java version "11.0.1" 2018-10-16 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.1+13-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.1+13-LTS, mixed mode)

Any idea of why?

Upvotes: 4

Views: 3607

Answers (3)

user1689987
user1689987

Reputation: 1546

This will work: https://www.java.com/en/download/uninstalltool.jsp

Worked for me when I saw on my Mac:

Failed to uninstall java xpc connection error

Upvotes: 0

Mazen K
Mazen K

Reputation: 3662

Navigate to /Library/Java/JavaVirtualMachines and remove the directory whose name matches the following format:

jdkmajor.minor.macro[_update].jdk

In my case, I had jdk-11.0.1.jdk jdk1.8.0_181.jdk

java -version

Shows the higher version number installed.

Reference of uninstalling the JDK

Upvotes: 0

Will
Will

Reputation: 7017

Run:

which java

To discover exactly where java is coming from. Then depending on the result, determine how to uninstall that particular one.

For example, on my machine:

$ which java
/usr/bin/java
$ ls -l /usr/bin/java
lrwxr-xr-x  1 root  wheel  74 Jan 19  2018 /usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java

Upvotes: 3

Related Questions