How to Uninstall the JDK & JRE on macOS
Uninstalling the JDK on macOS
To uninstall the JDK on macOS:
You must have Administrator privileges.
Remove the directory whose name matches the following format by executing the rm command as a root user or by using the sudo tool:
/Library/Java/JavaVirtualMachines/jdk-major.minor.security.patch.jdk
For example, to uninstall jdk 17.0.1:
% sudo rm -rf /Library/Java/JavaVirtualMachines/jdk17.0.1.jdk
Uninstalling the JRE on macOS
To uninstall the JRE on macOS:
You must have Administrator privileges.
Remove the JavaAppletPlugin.plugin directory by executing the rm command as a root user or by using the sudo tool.
% sudo rm -rf /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
Remove the JavaControlPanel.prefpane directory by executing the rm command as a root user or by using the sudo tool.
% sudo rm -rf /Library/PreferencePanes/JavaControlPanel.prefPane
% sudo rm -rf ~/Library/Application\ Support/Oracle/Java
Note: Do not 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 that you perform an update of the OS.
How do I clear the Java cache?
Note: After successfully uninstalling Java, you may remove java Deployment cache using these instructions.
To clear the applet and Web Start cache from a window, use the following command (note escaped space character):
% sudo rm -rf ~/Library/Application\ Support/Oracle/Java/Deployment/cache
Comments
Post a Comment