Reputation: 483
How to uninstall a specific java version from a mac?
When I execute the following command:
/usr/libexec/java_home -V
I see the following.
Matching Java Virtual Machines (2):
11.0.2, x86_64: "OpenJDK 11.0.2" /Library/Java/JavaVirtualMachines/openjdk-11.0.2.jdk/Contents/Home
1.8.0_202, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home
I want to uninstall just Java 11.0.2 and keep the second one.
Upvotes: 28
Views: 54403
Reputation: 747
Using Homebrew in the terminal did it easily for me. The following:
brew uninstall openjdk@11
// use java -version to verify that it's been uninstalled.
worked for me. The accepted answer did not work for me.
Upvotes: 3
Reputation: 101
sudo rm -rf /Library/Java/JavaVirtualMachines/jdk-11.0.5.jdk
Works for me
Upvotes: 10
Reputation: 4396
Run this command and it will remove the JDK
sudo rm -rf /Library/Java/JavaVirtualMachines/openjdk-11.0.2.jdk
Upvotes: 57