DEV Community

Cover image for How to Uninstall Java on Mac?
Ruthvik Raja M.V
Ruthvik Raja M.V

Posted on

How to Uninstall Java on Mac?

Hello everyone,

There are two methods to uninstall Java on your Mac and they are as follows:-

Method 1:-

  • Click on the Finder App.[Bottom left of your Mac]
  • Navigate to Applications Folder and type JavaAppletPlugin.plugin in the search bar.
  • Finally, move the plug-in to the Bin and empty the Bin.

Then, check whether the Java software was successfully uninstalled by typing the following command in the Terminal:-

java -version
Enter fullscreen mode Exit fullscreen mode

It should prompt you to install Java if the software was successfully uninstalled.

Method 2:-

Consider if you are unable to find the plugin by entering JavaAppletPlugin.plugin in the search bar [Application Folder], then follow the below steps to remove the concrete version of the Java file [Ex: JDK file]:-

  • Check what Java versions are available by entering the following command in the Terminal:
ls /Library/Java/JavaVirtualMachines/
Enter fullscreen mode Exit fullscreen mode
  • Remove the corresponding folder with that version:
sudo rm -fr /Library/Java/JavaVirtualMachines/jdk-9.0.1.jdk
Enter fullscreen mode Exit fullscreen mode

[Ex: In the above statement I am uninstalling Java 9]

Then, check whether the Java software was successfully uninstalled by typing the following command in the Terminal:-

java -version
Enter fullscreen mode Exit fullscreen mode

It should prompt you to install Java if the software was successfully uninstalled.

Done...

Oldest comments (0)