how to uninstall java openjdk in linux

https://w‮tual.ww‬turi.com
how to uninstall java openjdk in linux

To uninstall Java OpenJDK on Linux, you can use the package manager of your distribution to remove the OpenJDK package. The exact command to use will depend on the package manager you are using.

Here are the steps to uninstall Java OpenJDK on some common Linux distributions:

Ubuntu and Debian

  1. Open a terminal window.
  2. Run the following command to remove the OpenJDK package:
sudo apt-get remove openjdk-*

Fedora

  1. Open a terminal window.
  2. Run the following command to remove the OpenJDK package:
sudo dnf remove java-*

CentOS and Red Hat Enterprise Linux (RHEL)

  1. Open a terminal window.
  2. Run the following command to remove the OpenJDK package:
sudo yum remove java-*

Note that these commands will remove the OpenJDK package and any related packages, but they will not remove the Java configuration files or directories. If you want to completely remove all trace of Java from your system, you can use the find command to locate and delete any remaining Java files or directories.

Here's an example of how you can use the find command to remove all Java-related files and directories:

sudo find / -name "*java*" -exec rm -rf {} \;

This command will search the entire file system for files or directories with "java" in the name and delete them. Be careful when using this command, as it will delete any file or directory that matches the search criteria, regardless of its contents or importance.

Created Time:2017-11-01 20:43:02  Author:lautturi