Closed N30Z3N closed 2 years ago
What was the error with sudo apt-get install openjdk-8-jre
? I believe this is the way to install Java
What was the error with
sudo apt-get install openjdk-8-jre
? I believe this is the way to install Java
same error
Hi - sorry for the late response. I have not been active on this repo.
You can install Java in your project by adding this to the Dockerfile:
USER root
# Install "software-properties-common" (for the "add-apt-repository")
RUN apt-get update && apt-get install -y \
software-properties-common
## Install Oracle's JDK
# add oracle jdk repository
RUN add-apt-repository ppa:ts.sch.gr/ppa \
# accept oracle license
&& echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections \
&& echo debconf shared/accepted-oracle-license-v1-1 seen true | debconf-set-selections \
&& apt-get update \
# install oracle jdk 8 and make it default
&& apt-get -y install oracle-java8-installer \
&& apt-get -y install oracle-java8-set-default \
# clean up
&& apt-get clean all \
&& rm -rf /var/lib/apt/lists/*
USER coder
Ah, it looks like Java 8 is not supported on Debian 11. You can, however, use:
RUN sudo apt-get update && sudo apt-get install -y openjdk-11-jre
see this for workarounds: https://www.itzgeek.com/how-tos/linux/debian/how-to-install-java-jdk-on-debian-11.html
I also tried sudo apt-get install openjdk-8-jre which is mainly i want even that getting error