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
Videos
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