PopOS

How To Install the Java Compiler and Runtime on Pop!_OS

There are a ton of programs that require you to install Java in the system. There are still some services on the web that need Java runtime, despite most of them shifting away from Java applications to browser-integrated ones. Getting your hands on a Java Compiler to develop your skills is a good option. However, many beginners don’t know how to install a Java Compiler in Linux. So in this guide, we will explain different methods to install Java Compiler and Runtime on Pop!_OS, which is a Ubuntu-based OS.

How To Install Java Compiler and Runtime on Pop!_OS

This section has two parts where we will explain the installation process through the CLI and GUI approaches.

The CLI Approach

OpenJDK 11 comes as the pre-installed utility of Pop!_OS. So let’s start by updating the system running the following commands:

sudo apt update

sudo apt upgrade

Now, if your system already has Java, you can check its version through the following command:

java -version

The previous command will display the JRE version or else show the following result:

So, you can execute the following command to install Java:

sudo apt install default-jre

Now, run the following command to download the default JDK from OpenJDK 11:

sudo apt install default-jdk

You can also verify the compiler version by typing in the following command:

java -version

Or

javac -version

The GUI Approach

You can install the Java Compiler from the Pop!_OS built in a software center, i.e., Pop!_Shop.

First, open the Pop!_Shop, and search for the Synaptic Package Manager.

Now, click on the install button and then open Synaptic. Here, search “OpenJDK” in the search box to display the list of packages:

You will get the complete list of JDK packages; so right-click on the default-jdk to open the drop-down menu.

Finally, click on the mark for installation and then click the Apply button to install the packages in the system.

Conclusion

This article discussed installing Java Compilers and Runtime on Pop!_OS. You can run all the previous commands in Ubuntu because Pop!_OS is an Ubuntu-based Linux distro. We have used GUI and CLI approaches to install the Java packages easily. If you are unfamiliar with the commands, we recommend you use the GUI method.

About the author

Prateek Jangid

A passionate Linux user for personal and professional reasons, always exploring what is new in the world of Linux and sharing with my readers.