How to uninstall the «Java» application and delete its files from my Linux PC – do this

Linux has a free version of Java installed on its operating system by default, Open JDK, which works very well, however, It was outdated before the new update For users of this software.In this case, uninstall the version, download and install the latest free Java version, and then We will explain step by step how to perform this process in a simple way.

How can I remove the symlink to completely uninstall Java?

To uninstall a Java Open JDK release from a Linux system, you must have write access to the directory, which allows you to delete the symbolic link associated with it. By definition, a symbolic link is a direct way to access a file or program with any location, is the version of the Windows shortcut.

using java jdk and linux

To remove this type of link, use the commands: rm and unlink, as follows:

  • The first thing is open a terminalwhile pressing the command «Ctrl + Alt + T».
  • Then you type the following «ls -l «, which gives you a list of all the symlinks for your device, note the symlinks that correspond to the Java version you want to remove.
  • Via the rm command: you just need Enter the actuator «rm «, the symlink will be eliminated when typing.
  • Via the unlink command: Run the following line «Unlink < RutaDelEnlaceSimbolico>«, again, symlinks will be eliminated when typing.

Both of these commands work to eliminate any kind of symlinks in Linux, not just those corresponding to Java, so they are useful in different situations.

How to permanently uninstall Java applications from your computer?

After removing the Java symlink, You can’t think the app is deleted your system, for which you still have to execute a series of commands that depend on the version of Java you have installed. In any case, the first thing you should know is the version of Java you have, so in a terminal, execute the following command «java –version» and keep that identity, which will be useful during the process of uninstalling the software.

update java openjdk on linux

What are some ways to uninstall Java?

There are as many ways to uninstall Java from your computer as it is to install Java in any version of Ubuntu Linux, but broadly speaking, there are two ways to do it:

RPM uninstall

Redhat Package Manager, or RPM, is a manager that can easily install or uninstall programs on GNU/linux platforms, in this case we’ll show you how to use it to remove Java from your computer:

First make sure Install the RPM package On your computer, if not, go ahead and download and run it.

Once the process is done, you have to open a terminal (Ctrl + Alt + T) and enter the command «rpm -qa | grep -i {packagesearch}», (to search in packages you can Type the name of the program to uninstallin this case Java), will return the full name of the installed program, note.

The next command to enter is «rpm -e {packageuninstall}» (enter the Java full name you wrote down earlier in the package to uninstall), very simple, you will uninstall Java from your Linux system

Use the extract file

The second method we’ll explain to you works when the Java installation is complete. from Oracleusing the self-extracting package, the process is to manually remove all JVMs, the process is as follows:

  • Open a Linux terminal and run: «sudo dpkg –list | grep -i jre», which will output the installed Java version.
  • Enter the following command «sudo apt remove default-jre» followed by «S» so you will confirm the command to uninstall Java on your device.
  • To check, type «java –version» again, it shouldn’t return any results because you no longer have the tools available.

remove old version of java

How to delete leftover Java files from your PC?

You can delete all traces of Java on your computer to free up storage space and avoid inconsistencies in the Linux Ubuntu operating system as follows:

  • Run the following complete command «dpkg-query -W -f=»${binary:Package}\n» | grep -E -e ‘^(ia32-)?(Sun|Oracle)-Java’ -e ‘^openjdk-‘ -e ‘ ^icedtea’ -e ‘^(default|gcj)-j(re|dk)’ -e ‘^gcj-(.*)-j(re|dk)’ -e ‘^Java-common’ | xargs sudo apt -get -y delete
  • sudo apt-get -y autoremove», this will remove the package linked to Java.
  • Now enter the following «dpkg -l | grep ^rc | awk ‘{print($2)}’ | xargs sudo apt-get -y purge», make sure you don’t modify the code, Follow the process strictly, this includes deleting all configuration records.
  • Follow «sudo bash -c ‘ls -d /home/*/.java’ | xargs sudo rm -rf» to clear cache and Java configuration.
  • Using «sudo rm -rf /usr/lib/jvm/*», make sure to manually remove all installed JVMs.
  • This code is fairly extensive, Make sure to type correctly «for g in ControlPanel Java java_vm javaws jcontrol jexec keytool mozilla-javaplugin.so orbd pack200 policytool rmid rmiregistry servertool tnameserv unpack200 appletviewer apt extcheck HtmlConverter idlj jar jarsigner javac javadoc javah javap jconsole jdb jhat jinfo jmap jps jrunscript jsadebugd jstack jstat julstatd runner-vermicsciagenative2 xjc 1.9-javaplugin.so; do sudo update-alternatives –remove-all $g; done» will discard any remaining Java input.

use these commands you must clean thoroughlyany trace of Java on your Linux computer, however, you should always remember to be careful to avoid damaging your system

Deja un comentario