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) 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.

Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape,
GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out -
check it out now!
Last Updated :
06 Oct, 2021
Like Article
Save Article