0

In Docker file we are using the below url to download jdk11 but its not working anymore.

https://download.java.net/java/GA/jdk11/13/GPL/openjdk-11.0.1_linux-x64_bin.tar.gz

Getting error

wget https://download.java.net/java/GA/jdk11/13/GPL/openjdk-11.0.1_linux-x64_bin.tar.gz -O jdk.tar.gz -nv The certificate's owner does not match hostname 'download.java.net'

Is there any other way to download it?

Community
  • 1
  • 1
messi
  • 108
  • 9
  • Can you please be more specific? What command did you use? Any error message being displayed? – bratkartoffel Apr 29 '19 at 11:55
  • @bratkartoffel I have updated please help me out. – messi Apr 29 '19 at 11:56
  • The site presents certificate for "download.oracle.com", not for "download.java.net". Official installation guide (https://openjdk.java.net/install/) leads to Oracle's website, not to download.java.net. Probably your link is a bit deprecated. – Danila Kiver Apr 29 '19 at 12:28

1 Answers1

3

The site https://download.java.net/ has an SSL certificate error.

The configured certificate for this site lists the domain download.oracle.com (domain mismatch).

Maybe because The JDK 11 Early Access Program has concluded see:

https://jdk.java.net/11/

Try to download from: https://github.com/AdoptOpenJDK/openjdk11-upstream-binaries/releases/download/jdk-11.0.3%2B7/OpenJDK11U-x64_linux_11.0.3_7.tar.gz

AAber
  • 1,562
  • 10
  • 14
  • But in docker file what we have to add? If i add the url link it says forbidden error. – messi Apr 29 '19 at 12:36
  • Please post the first line of the Docker file (the line with FROM) – AAber Apr 29 '19 at 12:39
  • using wget download it. RUN set -ex && \ apt-get update && apt-get install -y wget unzip && \ wget https://download.java.net/java/GA/jdk11/13/GPL/openjdk-11.0.1_linux-x64_bin.tar.gz -O jdk.tar.gz -nv && \ mkdir -p /opt/jdk && \ tar zxvf jdk.tar.gz -C /opt/jdk --strip-components=1 && \ rm jdk.tar.gz && \ rm /opt/jdk/lib/src.zip – messi Apr 29 '19 at 12:43
  • I updated the link to an alternate location, I downloaded it and it works. – AAber Apr 29 '19 at 12:44
  • But how can i rely on this? I need to add it in production. – messi Apr 29 '19 at 12:53
  • Use the link above to download the tar file. Rename the file jdk.tar.gz. Copy the tar file into the docker using the docker ADD command. – AAber Apr 29 '19 at 14:00
  • Then remove the wget command from the Dockerfile, this will ensure you have the Java tar file for your production builds. – AAber Apr 29 '19 at 14:08