uninstall java from mac terminal

‮//:sptth‬www.lautturi.com
uninstall java from mac terminal

To uninstall Java from a macOS computer using the terminal, you can follow these steps:

  1. Open the terminal on your macOS computer.

  2. Run the following command to remove the Java runtime and JDK:

sudo rm -rf /Library/Java/JavaVirtualMachines/*

This will delete the Java virtual machine (JVM) and JDK files from your system.

  1. Run the following command to remove any remaining Java directories or files:
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/Application\ Support/Oracle/Java

This will delete any remaining Java directories or files that may have been left behind after the uninstallation process.

  1. Check your system's PATH environment variable to ensure that it does not contain any references to the Java installation. You can do this by running the following command:
echo $PATH

If the PATH variable contains any references to the Java installation, you can remove them by editing the ~/.bash_profile file. Open the file in a text editor and remove any lines that contain java or javac. Save and close the file, then reopen the terminal to apply the changes.

After following these steps, Java should be completely removed from your macOS system.

Created Time:2017-10-17 22:51:25  Author:lautturi