🌐
DigitalOcean
digitalocean.com › community › tutorials › how-to-install-java-with-apt-on-ubuntu-22-04
How to Install Java with Apt on Ubuntu (JRE & JDK) | DigitalOcean
February 2, 2026 - Learn how to install Java (JRE & JDK) on Ubuntu using apt. Step-by-step guide to setting up Java, verifying installation, and managing multiple versions.
🌐
DigitalOcean
digitalocean.com › community › tutorials › how-to-install-java-with-apt-on-ubuntu-20-04
How To Install Java with Apt on Ubuntu | DigitalOcean
February 5, 2026 - Outputopenjdk version "21.0.9" 2025-10-21 OpenJDK Runtime Environment (build 21.0.9+10-Ubuntu-124.04) OpenJDK 64-Bit Server VM (build 21.0.9+10-Ubuntu-124.04, mixed mode, sharing) Note: The exact patch version and build number may vary depending on available security updates. Confirm that the Java compiler is available by running: ... Your system now has a complete Java development environment installed. In most cases, installing the default OpenJDK package is enough.
Discussions

Java compiler in Ubuntu for Windows

I want to know if there is a way to add the compiler that I downloaded from apt-get to the Windows path

There isn't. If your windows based editing environment requires you to have a java compiler installed then you need to install a compiler on windows. It's one of the major annoyances of wsl programming.

That said, I probably wouldn't use wsl at all for java programming. It's one of the few languages that doesn't feel annoying to program on windows at all. It has great windows tooling and build scripts.

More on reddit.com
🌐 r/bashonubuntuonwindows
4
4
March 15, 2019
Can someone please guide me through the installation of JDK on Linux?

If it's based on Ubuntu you'll be able to install it via the package manager.

Go to your shell and type

sudo apt-get install openjdk-8-jdk

This will install OpenJDK, not Oracle JDK. For the Oracle JDK you need to add a PPA first:

sudo add-apt-repository ppa:webupd8team/java

sudo apt-get update

sudo apt-get install oracle-java8-installer

More on reddit.com
🌐 r/java
9
0
February 8, 2016
How do i install Java on Xubuntu?
sudo apt install openjdk-8-jre More on reddit.com
🌐 r/linuxmasterrace
22
0
January 8, 2018
How do you install java jdk in linux ubuntu 14.04
http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html More on reddit.com
🌐 r/java
9
0
August 27, 2015
🌐
TheServerSide
theserverside.com › blog › Coffee-Talk-Java-News-Stories-and-Opinions › How-do-I-install-Java-on-Ubuntu
How to install Java 21 on Ubuntu
A quick java --version check will tell you if an install is necessary: java - version Command 'java' not found, but can be installed with: sudo apt install default-jre · If the command indicates that Java is not found, proceed with the next steps.
🌐
freeCodeCamp
freecodecamp.org › news › how-to-install-java-in-ubuntu
How to Install Java in Ubuntu – JDK Linux Tutorial
August 11, 2024 - In this article, I will cover everything you need to know and do to configure your Ubuntu operating system for Java development. I will explain each of the processes with appropriate screenshots and test runs. I have also created a full-length video showing all of the procedures. You can find the video at the end of this article. By the way, if you're wondering, "Hey Fahim! Who told you that installing Java on Windows is easier?", then you should probably check out my article on how to install Java on Windows.
🌐
Ubuntu
ubuntu.com › tutorials › install-jre
Install the Java Runtime Environment | Ubuntu
In this guide, we’ll be going through the installation of both JRE packages. Of course, you generally only need to pick the one that best suits your needs and preferences. ... That’s all you need. If you have that, let’s proceed to the next step! With new versions of Java released every 6 months, there are multiple versions available for use.
🌐
LinuxConfig
linuxconfig.org › home › install java on ubuntu 26.04
Install Java on Ubuntu 26.04
March 15, 2026 - ... Install the default JRE: Use the default-jre metapackage to install the Java Runtime Environment. ... This will install OpenJDK and all required dependencies automatically. Confirm the installation: Verify that the JRE is correctly installed ...
🌐
Blogger
thehow2everything.blogspot.com › 2014 › 01 › how-to-install-java-compiler-javac-in.html
The How To Everything: How to Install Java Compiler / javac in Ubuntu
You will be asked for authorization ... · Type in sudo apt-get update to update the packages · Then type in sudo apt-get install openjdk-7-jdk once more and that should do the trick...
🌐
TecMint
tecmint.com › home › linux distros › ubuntu › how to install java on ubuntu 24.04, ubuntu 22.04, and ubuntu 20.04
How to Install Java (OpenJDK) on Ubuntu 24.04
June 4, 2024 - This tutorial will show you how to install Java on Ubuntu 24.04, Ubuntu 22.04, and Ubuntu 20.04 from the Ubuntu repository and the official Oracle package.
Find elsewhere
🌐
OneUptime
oneuptime.com › home › blog › how to install java (openjdk) on ubuntu
How to Install Java (OpenJDK) on Ubuntu
January 15, 2026 - ... # Check if Java is installed and which version java -version # Check if Java compiler is installed javac -version ... # Update package lists sudo apt update # Install the default JDK (includes JRE) sudo apt install default-jdk -y # Verify ...
🌐
Hostinger
hostinger.com › home › tutorials › how to install java on ubuntu
How to Install Java on Ubuntu
January 13, 2026 - Check this article to learn how to install Java on Ubuntu: 1. Update the package index 2. Install JRE 3. Install a specific Java version and more.
🌐
Ubuntu
help.ubuntu.com › community › Java
Java - Community Help Wiki - Official Ubuntu Documentation
To install the development environment, install the java-gcj-compat-dev package using any installation method. GCJ is a front end to the GCC compiler which can natively compile both Java(tm) source and bytecode files. The compiler can also generate class files.
🌐
Ubuntu
documentation.ubuntu.com › ubuntu-for-developers › tutorials › java-use
Develop with Java on Ubuntu - Ubuntu for Developers
3 weeks ago - For instructions on how to install Java and related tooling, including IDEs, see the dedicated guide on How to set up a development environment for Java on Ubuntu. This article assumes that tooling suggested in that article has been installed. javac is the actual compiler, but developers usually ...
🌐
It's FOSS
itsfoss.com › install-java-ubuntu
How to Install Java on Ubuntu and Linux Mint [Properly]
August 1, 2024 - It contains the Java Compiler (javac) package. In a terminal, use the following command to install OpenJDK Java Development Kit: ... This will install the latest JDK available from Ubuntu.
🌐
Linode
linode.com › docs › guides › install-java-on-ubuntu-16-04
Install Java on Ubuntu 16.04 | Linode Docs
May 30, 2017 - This guide shows how to install the OpenJDK 8 runtime environment to support Java app execution and development on a Linode running Ubuntu version 16.04.
🌐
Cherry Servers
cherryservers.com › home › blog › linux › how to install java on ubuntu 22.04 | step-by-step tutorial chatbots
How to Install Java on Ubuntu 22.04 | Step-by-Step Tutorial chatbots | Cherry Servers
November 7, 2025 - In this step-by-step Java tutorial, you will learn how to install Java on Ubuntu 22.04 server in multiple ways, including how to configure the default Java version on Ubuntu, and configure JAVA_HOME Environment Variable.
🌐
Virtarix
virtarix.com › home › blog › how to install java 25 on ubuntu using apt-get
How to Install Java 25 on Ubuntu Using apt-get | Virtarix
December 5, 2025 - Learn to install Java 25 on Ubuntu using apt or manual methods. Get supported Ubuntu versions, setup, configuration, managing versions & troubleshooting.
🌐
PhoenixNAP
phoenixnap.com › home › kb › sysadmin › how to install java on ubuntu
How to Install Java on Ubuntu
February 20, 2025 - Install one or several Java packages on your system, or choose a specific version by specifying the version number. By default, Ubuntu includes OpenJDK as the Java Development Kit (JDK) and Java Runtime Environment (JRE).
🌐
Guru99
guru99.com › home › java tutorials › how to install java in ubuntu (linux)
How to Install Java in Ubuntu (Linux)
September 16, 2024 - JAVA_HOME=<Directory where JAVA has been extracted>/jdk1.8.0 PATH=$PATH:$HOME/bin:$JAVA_HOME/bin export JAVA_HOME export PATH ... Step 7) Its time to let Ubuntu know where our JDK/JRE is located. Copy-paste below lines into a command prompt. sudo update-alternatives --install "/usr/bin/java" "java" "<Directory where JAVA has been extracted>/bin/java" 1 sudo update-alternatives --install "/usr/bin/javac" "javac" "<Directory where JAVA has been extracted>/bin/javac" 1 sudo update-alternatives --install "/usr/bin/javaws" "javaws" "<Directory where JAVA has been extracted>/bin/javaws" 1
🌐
DigitalOcean
digitalocean.com › community › tutorials › how-to-install-java-with-apt-on-ubuntu-18-04
How To Install Java with Apt on Ubuntu 18.04 | DigitalOcean
October 12, 2021 - In this guide, you will install various versions of the Java Runtime Environment (JRE) and the Java Developer Kit (JDK) using apt. You’ll install OpenJDK as well as the official JDK from Oracle. You’ll then select the version you wish to use for your projects. When you’re finished, you’ll be able to use the JDK to develop software or use the Java Runtime to run software. ... One Ubuntu 18.04 server set up by following the the Ubuntu 18.04 initial server setup guide tutorial, including a sudo non-root user and a firewall.
🌐
Wikihow
wikihow.com › computers and electronics › operating systems › linux › ubuntu › 4 easy ways to install java in ubuntu using terminal - wikihow
4 Easy Ways to Install Java in Ubuntu Using Terminal - wikiHow
December 17, 2025 - Do you need to run Java programs on Ubuntu? Perhaps you want to use Java to create applications. Java is a general-purpose programming language that is designed to run on any platform with as few dependencies as possible. Java Runtime Environment (JRE) allows you to run Java applications on your computer. Java Development Kit (JDK) allows you to write and compile programs in Java. You can easily install Open Java using the Terminal.