Categories: Ubuntu

How to Uninstall Java from Ubuntu 22.04

JAVA is the programming language used in most mobile and web applications for a long time, and also many famous companies are using it for the purpose of developing software. In this blog, we will explore the method of uninstalling the Java package from Ubuntu using the command-line interface.

How to uninstall Java from Ubuntu

To uninstall the package of Java from Ubuntu, we will first confirm that it is being installed or not, for which there are two different commands, first one is to list down all the installed packages and then filter out only the packages that include java using the grep command:

Sponsored
$ sudo apt list –installed | grep java

Another way to confirm the installation of Java is by displaying the installed version of Java by running the command:

$ java –version

Now, we will find out the location of the java packages on Ubuntu. Commonly they are present either in the /opt/ directory or in the /usr/lib/ directory which can be found out by hit and trial methods. In our Ubuntu machine, it is being stored in ls /usr/lib/jvm that can be listed down by running the command:

$ ls /usr/lib/jvm

As we can see that all the packages and configuration files are located in this directory so we will remove the directory of jvm using the command:

Sponsored
$ sudo rm -r /usr/lib/jvm

To confirm the uninstallation of the java, we will display the version of Java using the command:

$ java –version

The output is the confirmation that there is no package of Java installed anymore.

Conclusion

To uninstall the Java package from Ubuntu 22.04, we will run the command “sudo rm -r /usr/lib/jvm ” after confirming the directory of jvm.  In this write-up, the method of uninstalling Ubuntu has been explained in detail.

Ubuntu Server Admin

Recent Posts

How to Install Google Cloud AI Python client library to interact with Vertex AI

In this article, we will see how to install google cloud AI Python client library…

3 hours ago

Meet the Canonical Ceph team at Cephalocon 2024

Photo by Jeton Bajrami on Unsplash Date: December 4-5th, 2024 Location: Geneva, Switzerland In just…

24 hours ago

The transition to in-house software development in the automotive industry

Who will win the race to the perfect SDV? The automotive industry is experiencing a…

24 hours ago

Profile-guided optimization: A case study

Software developers spend a huge amount of effort working on optimization – extracting more speed…

24 hours ago

Ubuntu Weekly Newsletter 866

Welcome to the Ubuntu Weekly Newsletter, Issue 866 for the week of November 10 –…

2 days ago

Ubuntu vs Debian: Linux Distributions Compared Deep Dive

Debian and Ubuntu are two popular Linux distributions. In this deep dive we will guide…

2 days ago