From the official Oracle manual.

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

/Library/Java/JavaVirtualMachines/jdkmajor.minor.macro[_update].jdk

For example, to uninstall 8u6:

%rm -rf jdk1.8.0_06.jdk

Do not attempt to uninstall Java by removing the Java tools from /usr/bin. This directory is part of the system software and any changes will be reset by Apple the next time you perform an update of the OS.

To remove system files you need to add sudo before rm -rf command.

Answer from Danila Zharenkov on Stack Overflow
🌐
MacPaw
macpaw.com › how to › optimization › apps
How to uninstall OpenJDK: Mac user guide
January 10, 2025 - Type the following, replacing [name of OpenJDK folder] with the name of the OpenJDK folder: sudo rm -rf [name of OpenJDK folder] Press Return. Enter your admin password followed by Return.
Discussions

macos - How to remove OpenJDK and go back to regular JDK - Ask Different
I mistakenly installed openJDK and I want to uninstall it and revert back to using regular JDK I had before, how do I do this? I can’t find anywhere how I can I uninstall it and go back to JDK. More on apple.stackexchange.com
🌐 apple.stackexchange.com
June 14, 2021
How to uninstall Java
I did this to remove Oracle JDK 8. https://www.java.com/en/download/help/mac_uninstall_java.html For OpenJDK it looks like you just have to delete the JDK directory. https://www.codejava.net/java-se/uninstall-jdk-on-macos More on reddit.com
🌐 r/MacOS
2
3
August 6, 2022
java - uninstall openjdk in mac - Stack Overflow
I did navigate to /Library/Java/JavaVirtualMachines and removed the jdk, and there is nothing in that folder anymore. But my terminal shows I have some version of java, so I am a little confused, I... More on stackoverflow.com
🌐 stackoverflow.com
Uninstall AdoptOpenJDK from Mac
How to uninstall properly AdoptOpenJDK from MacOS Catalina? I installed it with the package OpenJDK11U-jdk_x64_mac_hotspot_11.0.6_10.pkg More on github.com
🌐 github.com
3
January 26, 2020
🌐
Apple Community
discussions.apple.com › thread › 251661762
What is the best way to remove openjdk - Apple Community
I think they are referring to the downloaded application, not the JDK. Nevertheless, it is conceivable that deleting the application will also delete the JDK. If it does not, then you will need to search Oracle's site for an uninstaller or ask their tech support how the JDK can be removed.
🌐
Azul
docs.azul.com › core › uninstall › other-distributions
Uninstalling other OpenJDK distributions
Depending on your software packaging and deployment system, different commands can be used on macOS and Linux. # Check all the installed packages % brew list # Uninstall example, depending on the installed package, for example 'openjdk' % brew uninstall --formulae openjdk
🌐
CodeJava
codejava.net › java-se › uninstall-jdk-on-macos
How to Completely Uninstall JDK on macOS
April 29, 2022 - Then type the following command to remove a JDK installation completely from macOS: sudo rm -rf jdk-versionThis command will be executed under root privilege (password required) - the specified JDK directory will be deleted recursively and forcefully.If you uninstall JDK 1.8, you also need ...
🌐
Sahr Thomas Acton
actonnotes.wordpress.com › 2020 › 11 › 22 › how-to-remove-openjdk-version-15-on-apple-macos
How to remove openjdk version “15” on apple macOS
November 22, 2020 - 3. navigate to the folder where JavaVirtualMachines is installed “cd /Users/user1/Library/Java/“ 4. remove it. sudo rm -fr JavaVirtualMachines/* Please note that this command will remove all JavaVirtualMachines on your machine 4.1 – Type ...
Find elsewhere
🌐
Mac Install Guide
mac.install.guide › java › uninstall
Uninstall Java on Mac · Mac Install Guide · 2026
Remove specific OpenJDK versions. You might have some of these versions: $ brew uninstall openjdk $ brew uninstall openjdk@25 $ brew uninstall openjdk@21 $ brew uninstall openjdk@17
🌐
iMyMac
imymac.com › powermymac › uninstall adoptopenjdk on mac: follow these steps
Uninstall AdoptOpenJDK on Mac: Follow These Steps
August 12, 2024 - If you used HomeBrew to install the JDK app before, you can also uninstall AdoptOpenJDK on Mac using the commands such as: brew uninstall openjdk8 or brew uninstall adoptopenjdk8
🌐
Osx Uninstaller
osxuninstaller.com › uninstall-guides › remove-openjdk
How do I Completely Remove OpenJDK from macOS and Mac OS X?
November 27, 2018 - Step 2. Then, the uninstaller will analysis the target app as fast as in a few seconds later, click the button “Complete Uninstall” when all the related folders and flies appeared in the list. Step 3. The tool will easily delete all the related folders and flies scanned in Step 2, now press Back to Step 1 and click Refresh, OpenJDK is gone from the list. Now, OpenJDK is gone for good in your macOS computer, you don’t have to worry about the remaining issue on the hard drive.
🌐
Reddit
reddit.com › r/macos › how to uninstall java
r/MacOS on Reddit: How to uninstall Java
August 6, 2022 -

I installed several versions of the JDK, both official and open source. But I no longer need them. How exactly do you "uninstall" Java on macOS?

The best I can figure is just to go into HD/Library/Java and just delete everything there. Slightly new to macOS so wondering if this is right. The installers themselves don't give any means of uninstalling.

🌐
YouTube
youtube.com › watch
How to Completely Uninstall JDK on macOS - YouTube
Steps to completely remove Java Development Kit (JDK) installations from macOS computer. In this video, I'll show you:- Uninstall OpenJDK 18- Uninstall Oracl...
Published   April 23, 2022
🌐
UninstallMacApp
uninstallmacapp.com › openjdk-7-for-os-x-lion-removal.html
Remove OpenJDK 7 for OS X Lion from Mac system - Howto Guide
Download Mac App Remover · When installed, OpenJDK 7 for OS X Lion creates files in several locations. Generally, its additional files, such as preference files and application support files, still remains on the hard drive after you delete OpenJDK 7 for OS X Lion from the Application folder, in case that the next time you decide to reinstall it, the settings of this program still be kept. But if you are trying to uninstall OpenJDK 7 for OS X Lion in full and free up your disk space, removing all its components is highly necessary.
🌐
Stack Overflow
stackoverflow.com › questions › 68737022 › uninstall-openjdk-in-mac
java - uninstall openjdk in mac - Stack Overflow
I did navigate to /Library/Java/JavaVirtualMachines and removed the jdk, and there is nothing in that folder anymore. But my terminal shows I have some version of java, so I am a little confused, I...
🌐
Iboostup
iboostup.com › how-to-uninstall › net.java.openjdk.jdk
How to uninstall OpenJDK 16 by Java from your Mac
- Click "Select Application", then select "OpenJDK 16" from the list and click "Uninstall". - Enter your password if prompted, you may choose to skip this by clicking cancel — note that skipping this prompt will leave some files behind that ...
🌐
GitHub
github.com › adoptium › installer › issues › 187
Uninstall AdoptOpenJDK from Mac · Issue #187 · adoptium/installer
January 26, 2020 - Hello, How to uninstall properly AdoptOpenJDK from MacOS Catalina? I installed it with the package OpenJDK11U-jdk_x64_mac_hotspot_11.0.6_10.pkg Is it enough to delete the folder /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk from ...
Author   adoptium
🌐
javathinking
javathinking.com › blog › how-to-uninstall-java-from-mac-completely-jre-and-jdk
How to Uninstall Java Completely from Mac (JRE & JDK): Fix OpenJDK Still Showing in Terminal — javathinking.com
By following these steps, you’ll completely uninstall Java (JRE/JDK) from your Mac and resolve issues with lingering OpenJDK versions in the terminal.
🌐
Super User
superuser.com › questions › 1772970 › can-not-uninstall-java-from-mac-m1
macos - Can not uninstall java from mac M1 - Super User
March 10, 2023 - Did you mean openjdk, openjdk@11, openjdk@17, openj9 or openjdk@8? rahul@doctor ~ % brew uninstall openjdk@19 Error: No such keg: /opt/homebrew/Cellar/openjdk@19