I was able to unistall jdk 8 in mavericks successfully doing the following steps:
Run this command to just remove the JDK
sudo rm -rf /Library/Java/JavaVirtualMachines/jdk<version>.jdk
Run these commands if you want to remove plugins
sudo rm -rf /Library/PreferencePanes/JavaControlPanel.prefPane
sudo rm -rf /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
sudo rm -rf /Library/LaunchAgents/com.oracle.java.Java-Updater.plist
sudo rm -rf /Library/PrivilegedHelperTools/com.oracle.java.JavaUpdateHelper
sudo rm -rf /Library/LaunchDaemons/com.oracle.java.Helper-Tool.plist
sudo rm -rf /Library/Preferences/com.oracle.java.Helper-Tool.plist
Answer from Samuel Alpoim on Stack OverflowI was able to unistall jdk 8 in mavericks successfully doing the following steps:
Run this command to just remove the JDK
sudo rm -rf /Library/Java/JavaVirtualMachines/jdk<version>.jdk
Run these commands if you want to remove plugins
sudo rm -rf /Library/PreferencePanes/JavaControlPanel.prefPane
sudo rm -rf /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
sudo rm -rf /Library/LaunchAgents/com.oracle.java.Java-Updater.plist
sudo rm -rf /Library/PrivilegedHelperTools/com.oracle.java.JavaUpdateHelper
sudo rm -rf /Library/LaunchDaemons/com.oracle.java.Helper-Tool.plist
sudo rm -rf /Library/Preferences/com.oracle.java.Helper-Tool.plist
You just need to use these commands
sudo rm -rf /Library/Java/*
sudo rm -rf /Library/PreferencePanes/Java*
sudo rm -rf /Library/Internet\ Plug-Ins/Java*
You can get official oracle instruction to remove java from macOS here
In your macOS terminal type this one by one
Copysudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
sudo rm -fr /Library/PreferencePanes/JavaControlPanel.prefPane
sudo rm -fr ~/Library/Application\ Support/Oracle/Java
After that you can navigate to specific version of java that you intend to delete by using the following command:
Copycd /Library/Java/JavaVirtualMachines
Then type ls in your terminal to list down all the Java Virtual Machine Folders.
Finally add the version number you want to delete like this
sudo rm -rf jdk-10.0.1.jdk
Instead of jdk-10.0.1.jdk you can give any version number which are listed down in your above mentioned folder.
Update:
First remove the java runtime
Copy$ sudo mv /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin ~/ $ sudo mv /Library/PreferencePanes/JavaControlPanel.prefpane ~/Now you can close and reopen the System Preferences window to see that the icon is gone.
Next, uninstall the Java JDK. Open a terminal and change to the Java directory:
Copy$ cd /Library/Java/JavaVirtualMachinesYou can use
lsat the prompt to see what is in the directory and copy the jdk's path name with version number that you wish to delete.Copy$ ls --directory *jdk* examplejdk-7.jdkCopy the exact name of the path you want to remove -- for this example it's
examplejdk-7.jdk. Next, use that path name inside of single quotes ('examplejdk-7.jdk') to move it to your desktop. Instead of deleting the directory, this moves it to your desktop so you can restore it later in case there's an issue!Copy$ sudo mv 'examplejdk-7.jdk' ~/To confirm that it has been removed, run this command:
Copy
$ javaThis should output an error message:
No Java runtime present, requesting install
macos - How to uninstall java from mac completely? JRE and JDK - Stack Overflow
How to uninstall Java
macos - How to remove OpenJDK and go back to regular JDK - Ask Different
How to uninstall JDK on Mac OS?
Videos
To uninstall AdoptOpenJDK installed via Homebrew,
brew uninstall adoptopenjdk8
To uninstall OpenJDK installed via Homebrew,
brew uninstall openjdk8
The /usr/bin/java and other related tools are macOS shims that run a specific version of Java, as defined by the JAVA_HOME variable.
This variable is usually set in your ~/.bashrc file:
export JAVA_HOME=$(/usr/libexec/java_home -v1.8)`
You can check the current value:
$ echo $JAVA_HOME
/usr/local/Cellar/openjdk@8/1.8.0-392/libexec/openjdk.jdk/Contents/Home
You may have multiple versions of Java installed, to list them all:
$ /usr/libexec/java_home -V
Matching Java Virtual Machines (3):
21.0.1 (x86_64) "Homebrew" - "OpenJDK 21.0.1" /usr/local/Cellar/openjdk/21.0.1/libexec/openjdk.jdk/Contents/Home
17.0.9 (x86_64) "Homebrew" - "OpenJDK 17.0.9" /usr/local/Cellar/openjdk@17/17.0.9/libexec/openjdk.jdk/Contents/Home
1.8.0_392 (x86_64) "Homebrew" - "OpenJDK 8" /usr/local/Cellar/openjdk@8/1.8.0-392/libexec/openjdk.jdk/Contents/Home
/usr/local/Cellar/openjdk/21.0.1/libexec/openjdk.jdk/Contents/Home
In my case, you can see there are three versions of OpenJDK installed via homebrew. I can look them up in the list of installed packages:
$ brew list | grep -iE 'java|jdk|temurin'
openjdk
openjdk@17
openjdk@8
If I wanted to remove all of them, I could do brew uninstall them one by one, or:
(brew list | grep -iE 'java|jdk|temurin'); do brew uninstall $pkg; done
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.
I downloaded the ARM64 DMG Installer from Oracle for a quick task, now I want to delete Java, but I can't locate it, in ~/Library/ there are no Java files.
How can I delete it?
your help is greatly appreciated