How to uninstall java in mac

Sometime we need to use the lower version of java on our machine, and install the old one or some other use case. To uninstall the java version on the mac is very easy.

Steps: How to uninstall java in mac

  • Detect the list of packeges/Java installed on the mac with command
  • Copy the path of a particular version which needed to be uninstalled
  • Add the Path to the Sudo rm to remove that particular version.
  • Full Commands/Steps below,

Here is the command to get the list of java versions installed and to get the path of the java.

/usr/libexec/java_home -V

Remove the java with the directory come from the list. For example, if the path is /Library/Java/JavaVirtualMachines/zulu-22.jdk, you would run:

sudo rm -rf /Library/Java/JavaVirtualMachines/zulu-22.jdk

Remove Java Control Panel (if necessary):

sudo rm -rf /Library/PreferencePanes/JavaControlPanel.prefPane

Remove Java Plugin (if necessary):

sudo rm -rf /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin

This way JAVA will be uninstalled from you mac.

For more Flutter tutorials, Tips, Tricks, Free code, Questions, and Error Solving.


Leave a Comment