How to Install JDK in Linux?
Last Updated :
22 May, 2024
Java is a very popular general-purpose programming language, which is very close to flow Oop's theory and can run independently on any platform, but its run time environment is dependent on the platform the JVM (Java Virtual Machine) is also known as. Which first interprets Java file byte code and byte code into machine language. Here we are going to install JDK in the Debian-based Ubuntu operating system.
Step-by-Step Installation:
Step 1: Open your browser and navigate to this link.

Step 2: Scroll down and click on the JDK download link.

Step 3: Then choose the compatible file.

After clicking on the link they show the popup to confirm their terms and conditions to allow it and click on the download button.

Checkmark and click download.

Step 4: After download to navigate to your download folder, and open the terminal and go download folder.

Step 5: Type command.
sudo dpkg -i package_name
After type command press enter.

This process will take little time.
Step 6: After doing to above process the next step to update the paths and alternatives.
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk-15.0.2/bin/java 1

Output:

For alternatives:
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk-15.0.2/bin/javac 1

Output:

Step 7: Finally, The Java JDK is installed successfully.
Check Java properly install or not.

And check Javac is properly installed or not.
Similar Reads
How to Install Scala in Linux? Prerequisite: Introduction to Scala Before, we start with the process of Installing Scala on our System. We must have first-hand knowledge of What the Scala Language is and what it actually does? Scala is a general-purpose, high-level, multi-paradigm programming language. It is a pure object-oriente
3 min read
How to Install Hadoop in Linux? Hadoop is a framework written in Java for running applications on a large cluster of community hardware. It is similar to the Google file system. In order to install Hadoop, we need java first so first, we install java in our Ubuntu. Step 1: Check for JavaOpen your terminal and first check whether y
7 min read
How to Install Java JDK9 on Linux? As we all know Java is widely used in tech industries, with around 4 billion devices currently using java. This Java installation is going to be very easy and beginner-friendly. In this article, we are going to see a step-by-step guide on how you can install java on your Linux machine. Step-By-Step
4 min read
How to Install OpenJDK in Linux If you have started Java learning, you must have the Java Development Kit (JDK) installed on your system. OpenJDK is a free and open-source version of Java that provides everything you need to develop and run Java applications. Itâs a popular choice for developers because itâs easy to install and wo
4 min read
How to Install VisualVM in Linux When operating on a Java Virtual Machine, the sophisticated tool VisualVM offers a visual interface for viewing in-depth details about local and remote Java applications (JVM). To see the program within the JVM, it makes use of and integrates some of the command-line tools that the JDK offers; this
3 min read