Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 208
ashish1512 Avatar asked Mar 15 '19 18:03

ashish1512


People also ask

How do I completely remove Java 11?

Click Start, point to Settings, and then click the Control Panel. In the Control Panel, double-click the Add/Remove Programs. On the Install/Uninstall tab, click the Java version you want to uninstall, and then click Add/Remove.

Where is jdk 11 installed Mac?

The modular runtime image of JDK 11 contains the following folders: Note: In macOS, the JDK installation path is /Library/Java/JavaVirtualMachines/jdk-interim.


2 Answers

Run this command and it will remove the JDK

sudo rm -rf /Library/Java/JavaVirtualMachines/openjdk-11.0.2.jdk
like image 102
moritzg Avatar answered Oct 01 '22 19:10

moritzg


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

Works for me

like image 28
lookang lawrence wee Avatar answered Oct 01 '22 18:10

lookang lawrence wee