ashish1512
ashish1512

Reputation: 483

Uninstall Java version 11 mac

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

Answers (3)

Shayne3000
Shayne3000

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

lookang lawrence wee
lookang lawrence wee

Reputation: 101

sudo rm -rf /Library/Java/JavaVirtualMachines/jdk-11.0.5.jdk

Works for me

Upvotes: 10

moritzg
moritzg

Reputation: 4396

Run this command and it will remove the JDK

sudo rm -rf /Library/Java/JavaVirtualMachines/openjdk-11.0.2.jdk

Upvotes: 57

Related Questions