Java is a free-to-use object-oriented programming language. Java supports multithreading environments and incorporates complex technologies like machine learning and virtual reality. It is frequently used to develop web, desktop, android applications, games, etc. This article will demonstrate the installation of Java on Linux/Ubuntu 22.04 LTS.
Java is based on the following components:
The following steps will discuss the installation of the latest version of Java on Ubuntu 22.04 systems:
The first step to install Java is to update the system package:
The packages of dependencies are installed before installing JDK. By executing the following command, the math standard library will be installed:
It will take a few seconds for the installation process to complete.
The wget command line utility is used to download the JDK 20 “.deb” package from the official page by executing the following command:
It can be seen from the above image that the .deb package of JDK 20 is successfully installed.
“apt” (Advanced Packaging Tool) is a high-level package management system, i.e., it automatically checks and downloads all dependencies related to the package. It is the default package management tool in Debian. Java can be installed by using apt as follows:
From the above image, it can be seen that Java is installed successfully.
After successful installation, the Java environment is configured by executing the following commands in Terminal one by one:
> export JAVA_HOME=/usr/lib/jvm/jdk-20
> export PATH=$PATH:$JAVA_HOME/bin
> EOF
From the below image, it can be seen that the Java environment is configured and exported.
Finally, the “Jdk20.sh” profile file is executed by using the below-given command:
Java installation can be verified by checking the version of Java:
From the below image, it can be verified that the latest version of Java is successfully installed.
Java and its related directories can be removed by executing the following command:
From the output image, it can be verified that Java is successfully uninstalled.
Java is installed by first updating the system repositories, and then installing dependencies. After that, download the latest version of JDK, i.e., JDK 20, and then install it by executing the “sudo apt install ./jdk-20_linux-x64_bin.deb” command. This article has demonstrated the installation of Java on Linux/Ubuntu 22.04 LTS.
2024 was the GenAI year. With new and more performant LLMs and a higher number…
Canonical’s Kubernetes LTS (Long Term Support) will support FedRAMP compliance and receive at least 12…
Welcome to the Ubuntu Weekly Newsletter, Issue 878 for the week of February 2 –…
At Canonical, we firmly believe that delivering an outstanding, customer-centric support experience is impossible without…
I want to share how to install osTicket v1.14 for Ubuntu 20.04 server. osTicket written…
Now I want to share how to install WordPress on ubuntu 20.04 server. WordPress is…