RPM Package

Open a terminal window by clicking the “Applications” menu, pointing to “Accessories” and clicking “Terminal.” Become the root user by typing “su” into the terminal and pressing “Enter.” Type the root account’s password and press “Enter” to authenticate. Type “rpm -qa | grep java” into the terminal and press “Enter.” The name of each installed Java package appears in the terminal. Type “rpm -e package” into the terminal, replacing “package” with the name of the Java package from the previous command. You can remove multiple packages by separating each package name with a space. Press “Enter” to run the command and remove the packages.

Self-Extracting Installer

Open a terminal window by clicking “Applications” on the panel, pointing to “Accessories” and selecting “Terminal.” Type “su” into the terminal and press “Enter.” Type the root password at the password prompt and press “Enter” to become the root user. Locate the directory you installed Java to. Try using the “which java” command, which tells you the location of the Java binary file on your system. The location is often “/usr/java”, “/opt/jre_nb” or a subdirectory in “/usr/local/”. Type “rm -r /opt/java” into the terminal, replacing “/opt/java” with the directory Java is installed in. Press “Enter” to run the command and delete the directory. Writer Bio

A Guide on How to Remove Java in CentOS - 51