To install OpenJDK 11 in Ubuntu, use the commands listed below.

  1. Add the repository
sudo add-apt-repository ppa:openjdk-r/ppa
  1. Update package list
sudo apt-get update
  1. Install openjdk-11-jdk
sudo apt install openjdk-11-jdk
Answer from Tejas Lotlikar on askubuntu.com
🌐
Stack Overflow
stackoverflow.com › questions › 77837624 › e-unable-to-locate-package-openjdk-11-jdk-on-dockerfile
python - E: Unable to locate package openjdk-11-jdk on dockerfile - Stack Overflow
Now you have to change the FROM instruction since the default image for python:3.7 is bookworm and openjdk-11-jdk is available on bullseye: FROM python:3.7-bullseye RUN pip install --upgrade pip RUN apt-get update && \ apt-get install -y \ openjdk-11-jdk ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/ ENV PATH=$PATH:$JAVA_HOME/bin
🌐
Stack Overflow
stackoverflow.com › questions › 57960603 › e-unable-to-locate-package-openjdk-11-jdk
maven - E: Unable to locate package openjdk-11-jdk - Stack Overflow
E: Unable to locate package openjdk-11-jdk The command '/bin/sh -c apt-get install -y openjdk-11-jdk' returned a non-zero code: 100 · There is only java 8, there is no java 11. ... Thanks to Matt Schuchard for komment. I added java -version in Dockerfile and there realy was set open jdk 11.
Discussions

Update dockerfile please
3.350 E: Unable to locate package openjdk-11-jdk ------ Dockerfile:90 -------------------- 89 | 90 | >>> RUN mkdir -p /usr/share/man/man1 && \ 91 | >>> apt-get -y update && \ 92 | >>> apt-get -y --no-install-recommends install \ 93 | >>> openjdk-11-jdk \ 94 | >>> procps \ 95 | >>> bash-completion ... More on github.com
🌐 github.com
1
March 12, 2024
openjdk issue during node:latest build
Using node:latest, I've start to receive the following error, when I try to install openjdk-11-jdk during the docker build: E: Unable to locate package openjdk-11-jdk My dockerfile is something lik... More on github.com
🌐 github.com
1
June 14, 2023
Package 'openjdk-11-jre' has no installation candidate
Hello Everyone, I am using airflow through docker container, deployed on AWS fargate as a service which has been working completely fine for a long time but suddenly today I'm unable to deploy ... More on github.com
🌐 github.com
1
1
Unable to locate package when installing Java in docker - Stack Overflow
I'm trying to install Java in a docker image in order to make working with firebase a bit easier. When running the installation command I get the following error: Unable to locate package openjdk-1... More on stackoverflow.com
🌐 stackoverflow.com
July 17, 2020
🌐
GitHub
github.com › aertslab › scenicplus › issues › 322
Update dockerfile please · Issue #322 · aertslab/scenicplus
March 12, 2024 - 3.350 E: Unable to locate package openjdk-11-jdk ------ Dockerfile:90 -------------------- 89 | 90 | >>> RUN mkdir -p /usr/share/man/man1 && \ 91 | >>> apt-get -y update && \ 92 | >>> apt-get -y --no-install-recommends install \ 93 | >>> openjdk-11-jdk \ 94 | >>> procps \ 95 | >>> bash-completion \ 96 | >>> curl \ 97 | >>> libfftw3-dev \ 98 | >>> less && \ 99 | >>> rm -rf /var/cache/apt/* && \ 100 | >>> rm -rf /var/lib/apt/lists/* 101 | -------------------- ERROR: failed to solve: process "/bin/sh -c mkdir -p /usr/share/man/man1 && apt-get -y update && apt-get -y --no-install-recommends install openjdk-11-jdk procps bash-completion curl libfftw3-dev less && rm -rf /var/cache/apt/* && rm -rf /var/lib/apt/lists/*" did not complete successfully: exit code: 100
Author   aertslab
🌐
GitHub
github.com › docker-library › official-images › issues › 14851
openjdk issue during node:latest build · Issue #14851 · docker-library/official-images
June 14, 2023 - FROM node:latest ..... RUN apt-get update && \ apt-get install -y openjdk-11-jdk ca-certificates-java && \ apt-get clean && \ update-ca-certificates -f ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64/ RUN export JAVA_HOME ....
Author   docker-library
🌐
GitHub
github.com › apache › airflow › discussions › 31938
Package 'openjdk-11-jre' has no installation candidate · apache/airflow · Discussion #31938
I'd recommend to review what you install and make sure to use a modern JDK for your installation · Beta Was this translation helpful? Give feedback. ... There was an error while loading. Please reload this page. Something went wrong. There was an error while loading. Please reload this page. ... BTW. you crucially omitted the openjdk-11 from your Dockerfile but in the output it is clearly visible that you are trying to install it, so maybe you posted a wrong Dockerfile.
Author   apache
Find elsewhere
🌐
GitHub
github.com › elastic › elasticsearch › issues › 107613
Unable to locate package openjdk-11-jre-headless 7.17 ubuntu-2004-aarch64 · Issue #107613 · elastic/elasticsearch
April 18, 2024 - Exit-code 17 when calling /usr/local/bin/docker-compose, stdout: #0 building with "default" instance using docker driver #1 [geoip-fixture internal] load .dockerignore #1 transferring context: 2B done #1 DONE 0.0s #2 [geoip-fixture internal] load build definition from Dockerfile #2 transferring dockerfile: 354B done #2 DONE 0.0s #3 [geoip-fixture internal] load metadata for docker.io/library/ubuntu:18.04 #3 DONE 0.6s #4 [geoip-fixture 1/3] FROM docker.io/library/ubuntu:18.04@sha256:152dc042452c496007f07ca9127571cb9c29697f42acbfad72324b2bb2e43c98 #4 DONE 0.0s #5 [geoip-fixture 2/3] RUN apt-get
Author   elastic
🌐
GitHub
github.com › swarmpit › swarmpit › issues › 666
Build error on Dockerfile: Package 'openjdk-11-jre-headless' has no installation candidate · Issue #666 · swarmpit/swarmpit
July 5, 2023 - #0 2.649 This may mean that the package is missing, has been obsoleted, or #0 2.649 is only available from another source #0 2.649 #0 2.656 E: Package 'openjdk-11-jre-headless' has no installation candidate ------ Dockerfile:3 -------------------- 2 | 3 | >>> RUN apt-get update && \ 4 | >>> mkdir -p /usr/share/man/man1 && \ 5 | >>> apt-get install -y ca-certificates curl openjdk-11-jre-headless libjffi-java 6 | -------------------- ERROR: failed to solve: process "/bin/sh -c apt-get update && mkdir -p /usr/share/man/man1 && apt-get install -y ca-certificates curl openjdk-11-jre-headless libjffi-java" did not complete successfully: exit code: 100
Author   swarmpit
🌐
Docker Community
forums.docker.com › general
Ubuntu docker : unable to locate the package - General - Docker Community Forums
January 19, 2018 - I want to install OpenJDK-8-JDK on ubuntu docker but it failed bzy@bzy-Lenovo-IdeaPad-Y500:~/bittigercs503-1705/week4/executor$ sudo docker build . -t zhiweibao Sending build context to Docker daemon 4.608kB Step 1/4 : FROM ubuntu:16.0 —> 2a4cca5ac898 Step 2/4 : MAINTAINER zhiweibao —> Using cache —> a3d102eca4aa Step 3/4 : RUN apt-get update —> Using cache —> c681c5418af9 Step 4/4 : RUN apt-get install -y openjdk-8-jdk —> Running in 0703163e10ac Reading package lists…
🌐
GitHub
github.com › Springjunky › docker-local-build-environment › issues › 3
Unable to locate package openjdk-8-jdk · Issue #3 · Springjunky/docker-local-build-environment
March 21, 2018 - root@bpi-x:/home/bpi-x/docker-bpi-master# root@bpi-x:/home/bpi-x/docker-bpi-master# docker-compose up --build -d Building postgres Step 1/3 : FROM postgres ---> 30121e967865 Step 2/3 : COPY crea...
Author   Springjunky
🌐
LinuxQuestions.org
linuxquestions.org › questions › linux-newbie-8 › e-unable-to-locate-package-jdk-4175617153
E: Unable to locate package Jdk
can someone help me pleaseto install jdk, i am using ubuntu 16.06LTs gervais@gervais:~ sudo apt install jdk Reading package lists... Done Building
🌐
GitHub
github.com › splunk › docker-splunk › issues › 208
7.3 image unable to install java · Issue #208 · splunk/docker-splunk
June 24, 2019 - In the 7.2.6 image, default-jre installs Java 1.8. In the 7.3 image, it installs Java 11. So using openjdk-8-jre ... openjdk version "1.8.0_212" OpenJDK Runtime Environment (build 1.8.0_212-8u212-b03-2~deb9u1-b03) OpenJDK 64-Bit Server VM (build 25.212-b03, mixed mode) ... Reading package lists...
Author   splunk
🌐
Reddit
reddit.com › r/debian › need help: installing openjdk-11 on debian 12
r/debian on Reddit: Need Help: Installing OpenJDK-11 on Debian 12
June 21, 2023 -

I recently upgraded my Debian version to the shiny new Debian 12, and I'm currently facing a small hiccup while trying to install OpenJDK-11. I'm aware that the apt install default-jdk command usually does the trick, but in this case, it installs version 17 of OpenJDK. Unfortunately, I specifically need JDK 11 for my project.

I successfully used apt install default-jdk in Debian 11 without any issues, so I'm wondering if there have been any changes in Debian 12 that require a different approach for installing OpenJDK-11. I'd greatly appreciate it if anyone could kindly guide me through the correct steps to install OpenJDK-11 on Debian 12.

Thank you in advance for your time and assistance!