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
🌐
Azul
docs.azul.com › core › uninstall › other-distributions
Uninstalling other OpenJDK distributions
# Check all the installed packages $ sudo apt list --installed # Uninstall example, depending on the installed package, for example 'openjdk-17-jre' $ sudo apt remove openjdk-17-jre # To remove the package including all its files and configuration files, instead use $ sudo apt purge openjdk-17-jre ...
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
What is the best way to remove openjdk - Apple Community
There are many utilities that can uninstall applications. Here is a selection: ... The XLab FAQs and read the FAQ on removing software. ... I appreciate the response, it's very thorough. The JDK I have is not Oracle's, but OpenJDK which is an open source version of it. More on discussions.apple.com
🌐 discussions.apple.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
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
🌐
MacPaw
macpaw.com › how to › optimization › apps
How to uninstall OpenJDK: Mac user guide
January 10, 2025 - In order to uninstall OpenJDK, you need to locate its files in your Mac’s Library folder and drag them to the Trash. Note that the folder you need is the main Library folder, not your user Library folder that sits in your Home directory.
🌐
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 ...
🌐
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.
Find elsewhere
🌐
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
🌐
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.
🌐
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
🌐
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.

🌐
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
🌐
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 ...
🌐
UninstallMacApp
uninstallmacapp.com › openjdk-7-for-os-x-lion-removal.html
Remove OpenJDK 7 for OS X Lion from Mac system - Howto Guide
Open the Applications folder in the Finder (if it doesn’t appear in the sidebar, go to the Menu Bar, open the “Go” menu, and select Applications in the list), search for OpenJDK 7 for OS X Lion application by typing its name in the search field, and then drag it to the Trash (in the dock) to begin the uninstall process.
🌐
Dev2QA
dev2qa.com › home › how to install / uninstall multiple java versions in mac os by home brew or manually
How To Install / Uninstall Multiple Java Versions In Mac OS By Home Brew Or Manually Windows Tricks
September 12, 2022 - $ brew cask uninstall java ==> Uninstalling Cask java ==> Backing Generic Artifact 'openjdk-12.0.1.jdk' up to '/usr/local/Caskroom/java/12.0.1,69cfe15208a647278a19ef0990eea691/jdk-12.0.1.jdk'. Password: ==> Removing Generic Artifact '/Library/Java/JavaVirtualMachines/openjdk-12.0.1.jdk'.
🌐
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...
🌐
Oracle
java.com › mac_uninstall_faq
How do I uninstall Java on my Mac?
To uninstall JDK 7 and later versions, you must have Administrator privileges and execute the remove command either as root or by using sudo.
🌐
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
🌐
Nektony
nektony.com › home › blog › how to uninstall java on a mac completely
How to uninstall Java on Mac - Detailed steps
July 14, 2025 - However, when I do java –version, there is still a OpenJDK installed on my Mac: openjdk 11.0.17 2022-10-18 LTS OpenJDK Runtime Environment Corretto-11.0.17.8.1 (build 11.0.17+8-LTS) OpenJDK 64-Bit Server VM Corretto-11.0.17.8.1 (build 11.0.17+8-LTS, mixed mode) which java returns /usr/bin/java Any advice on how I can uninstall this openJDK version? ... I solved this issue by installing the Java version manager! For those having the same issue, I followed this guide on how to manage multiple Java versions on macOS, then I did