Referring to Ask Ubuntu question How to set JAVA_HOME for OpenJDK?,

How to install Open JDK (Java developement kit) in Ubuntu (Linux)?

  1. Open Terminal from Application Dash or press Ctrl+Alt+T

  2. Update repository:

    sudo add-apt-repository ppa:openjdk-r/ppa  # only Ubuntu 17.4 and earlier
    sudo apt update
    
  3. Optional: To search available distributions of openjdk, use the following command:

    apt search openjdk
    
  4. Install the appropriate version with the following command:

    sudo apt install openjdk-8-jdk
    sudo apt install openjdk-8-source #this is optional, the jdk source code
    
  5. For JAVA_HOME (Environment Variable) type command as shown below, in "Terminal" using your installation path...

    export JAVA_HOME=/usr/lib/jvm/java-8-openjdk
    

    (Note: /usr/lib/jvm/java-8-openjdk is symbolically used here just for demostration. You should use your path as per your installation.)

  6. For PATH (Environment Variable) type command as shown below, in Terminal:

    export PATH=$PATH:$JAVA_HOME/bin

  7. To check your installation:

    java -version

Answer from Dhaval Shah on Stack Overflow
🌐
Oracle
docs.oracle.com › en › java › javase › 22 › install › installation-jdk-linux-platforms.html
Installation of the JDK on Linux Platforms
March 14, 2024 - To install the 64-bit JDK Debian ... in any location having write access. ... The Java Development Kit files are installed into /usr/lib/jvm/jdk-<FEATURE>-oracle-<ARCH> directory....
Discussions

How do you manually install java openjdk?
Did you try follow the instructions? https://openjdk.org/install/ Then you have a folder with all the stuff you need. Now you need to tell your OS how to find the binaries and libraries. For that you need to tell us your OS (Debian, Ubuntu, Arch, Fedora, ...). More on reddit.com
🌐 r/linuxadmin
18
0
November 6, 2024
How to install JDK and Eclipse on Linux (Step by step)
First of all, congratulations on the content! Now I have to ask. Why Eclipse in 2025? Sorry for my ignorance, it's been a while since I've seen someone talking and/or using Eclipse. Is there any feature or use case where it's better than alternatives like Intellij Idea Community? More on reddit.com
🌐 r/linuxbrasil
7
16
February 11, 2025
Where is Java/the JDK installed on Linux?
Both rpm and dpkg systems typically use the "alternatives" system to support multiple installs of packages like java, so you can find yours like so: $ which java /usr/bin/java $ ls -l /usr/bin/java lrwxrwxrwx. 1 root root 22 Jan 29 15:08 /usr/bin/java -> /etc/alternatives/java* $ ls -l /etc/alternatives/java lrwxrwxrwx. 1 root root 72 Jan 29 15:08 /etc/alternatives/java -> /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b13-0.fc29.x86_64/jre/bin/java* My install of Java is in /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b13-0.fc29.x86_64 More on reddit.com
🌐 r/linux4noobs
9
6
February 16, 2019
How do I install JDK (Java Development Kit) from Ubuntu’s repositories?
you just install the package you want, default-jdk, default-jdk-headless or openjdk-11-jdk/openjdk-11-jdk-headless More on reddit.com
🌐 r/linux4noobs
3
3
August 29, 2021
🌐
Oracle
java.com › en › download › help › linux_x64_install.html
Linux 64-bit installation instructions for Java
Unpack the tarball and install Java tar zxvf jre-8u73-linux-x64.tar.gz The Java files are installed in a directory called jre1.8.0_73 in the current directory. In this example, it is installed in the /usr/java/jre1.8.0_73 directory.
🌐
OpenJDK
openjdk.org › install
OpenJDK: Download and install
Oracle's OpenJDK JDK binaries for Windows, macOS, and Linux are available on release-specific pages of jdk.java.net as .tar.gz or .zip archives. As an example, the archives for JDK 13 may be found on jdk.java.net/13 and may be extracted on the command line using ... The openjdk-8-jre package contains just the Java Runtime Environment. If you want to develop Java programs then please install the openjdk-8-jdk package.
🌐
GeeksforGeeks
geeksforgeeks.org › installation guide › how-to-install-jdk-in-linux
How to Install JDK in Linux? - GeeksforGeeks
July 23, 2025 - 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.
Find elsewhere
🌐
Oracle
oracle.com › java › technologies › downloads
Download the Latest Java LTS Free
Subsequent JDK 25 updates will be licensed under the Java SE OTN License (OTN) and production use beyond the limited free grants of the OTN license will require a fee. Linux · macOS · Windows · Documentation Download · Online Documentation · Installation Instructions ·
🌐
GeeksforGeeks
geeksforgeeks.org › java › download-and-install-jdk-on-windows-mac-and-linux
Download and Install JDK on Windows, Mac and Linux - GeeksforGeeks
April 4, 2026 - C:\Program Files\Java\jdk-{YOUR_JDK_VERSION}. Click on OK => OK => OK. ... Follow the steps below to install the Java software Development Kit on a Linux environment.
🌐
GitHub
gist.github.com › filipelenfers › ef3f593deb0751944bb54b744bcac074
Install JDK from tar.gz Ubuntu · GitHub
One needs to chmod o+x before users are able to start java. ... Thanks, this is what I ended up doing last night, i did as the root user and you can copy and paste this block · sudo apt install wget -y # in case you do not have wget wget https://github.com/ibmruntimes/semeru11-binaries/releases/download/jdk-11.0.22+7_openj9-0.43.0/ibm-semeru-open-jdk_x64_linux_11.0.22_7_openj9-0.43.0.tar.gz tar -xzvf ibm-semeru-open-jdk_x64_linux_11.0.22_7_openj9-0.43.0.tar.gz -C /usr/local/bin mv /usr/local/bin/jdk-11.0.22+7 /usr/local/bin/java sudo cat >> /etc/environment << EOF PATH="$PATH:/usr/local/bin/java/bin" EOF source /etc/environment java -version
🌐
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
January 1, 2025 - sudo apt install default-jre Setting up default-jdk-headless (2:1.21) ... Setting up openjdk-21-jdk:amd64 (21.0.5+11-1ubuntu~24.04.1) ... using /usr/lib/jvm/java-11-openjdk-amd64/bin/jconsole Setting up default-jdk (2:1.21) ...
🌐
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 - In this case, you would need Oracle JDK 11.0.13. Your version number may vary depending on when you’re installing the software. You don’t need to download anything from this page; you’ll download the installation script through apt shortly. Next, visit the Archive Downloads and locate the version that matches the one you need. From this list, choose the Linux x64 compressed archive .tar.gz package:
🌐
Linux Mint Forums
forums.linuxmint.com › board index › main edition support › software & applications
How to install JDK17? - Linux Mint Forums
September 5, 2022 - On Linux (Ubuntu 20.04 in particular), ...atisfiedLinkError: Can't load library: /usr/lib/jvm/java-17-openjdk-amd64/lib/libawt_xawt.so If so, use sudo apt install openjdk-17-jdk to install a full version....
🌐
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 image, the version of the ... you’ll download the installation script through apt shortly. Then visit the Downloads page and locate the version that matches the one you need. Click the JDK Download button and you’ll be taken to a screen that shows the versions available. Click the .tar.gz package for Linux....
🌐
Oracle
docs.oracle.com › en › industries › hospitality › enterprise-integrations › gaming-integration › 24.1 › gamig › t_download_jdk17_for_linux.htm
Download JDK17 for Linux
April 22, 2024 - Previous Next JavaScript must be enabled to correctly display this content ... There are three ways to install JDK on Linux. This guide describes the installation on RPM Based Linux.
🌐
Herongyang
herongyang.com › JDBC › JDK-Linux-Download-Installation.html
Downloading and Installing JDK on Linux
The best way to install JDK on your specific Linux platform is to use the package management tool on the system to search and automatically install the OpenJDK binary package that was built specifically for your platform.
🌐
wikiHow
wikihow.tech › computers and electronics › operating systems › linux › how to install jdk in linux: 12 steps (with pictures) - wikihow tech
How to Install JDK in Linux: 12 Steps (with Pictures) - wikiHow Tech
June 6, 2025 - This adds the Linux Uprising repository.[1] X Research source ... Type sudo apt update and press ↵ Enter. Now that the repository is ready, you can use it to install JDK. ... Type sudo apt install oracle-java12-installer and press ↵ Enter.
🌐
Linux Uprising
linuxuprising.com › 2019 › 02 › install-any-oracle-java-jdk-version-in.html
Install Any Oracle Java (JDK) Version In Ubuntu, Debian, Linux Mint Or Fedora With install-java.sh - Linux Uprising Blog
March 26, 2019 - sudo -E ./install-java.sh -f ~/Downloads/jdk-8u202-linux-x64.tar.gz -p /usr/lib/jvm This is the command with its output, so you can see what's going on when installing Oracle Java using the install-java.sh script:
🌐
DigitalOcean
digitalocean.com › community › tutorials › how-to-install-java-on-centos-and-fedora
How To Install Java on CentOS, Rocky Linux, RHEL, and Fedora | DigitalOcean
March 18, 2022 - Selection Command ----------------------------------------------- 1 java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.322.b06-2.el8_5.x86_64/jre/bin/java) + 2 java-17-openjdk.x86_64 (/usr/lib/jvm/java-17-openjdk-17.0.2.0.8-4.el8_5.x86_64/bin/java) * 3 /usr/java/jdk-17.0.2/bin/java Enter to keep the current selection[+], or type selection number: The steps in this tutorial should be sufficient in order to install and run any available version of Java depending on your use case. In this tutorial, you installed and managed multiple versions of Java using the yum package manager, the alternatives command, and environment variables. These are all fundamental aspects of Linux environment management, and Java provides an especially good example of working with them because of its many different versions.