bach: Cannot download OpenJDK using install-jdk.sh

It seems that a certificate error occurs and we can not download it using install-jdk.sh.

See https://travis-ci.org/mybatis/thymeleaf-scripting/jobs/525200361 .

Probably exit code ‘51’ is SSL connection error of cURL. (https://curl.haxx.se/docs/manpage.html#51)

Current Status (inserted by @sormuras)

  • 2019-04-27 Underlying reason: NET::ERR_CERT_COMMON_NAME_INVALID for all download.java.net assets
  • 2019-04-28 “Delay applying a temporary workaround until … mid of the coming week.”
  • 2019-04-29 Oracle/Mark Reinhold is working on it …
  • 2019-04-29 Updated install-jdk.sh to use https://download.oracle.com/java as the url prefix for OpenJDK assets

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 4
  • Comments: 16 (10 by maintainers)

Commits related to this issue

Most upvoted comments

From https://jdk.java.net/archive/ to https://jdk.java.net/13/ all download links now start with https://download.oracle.com – will update install-jdk.sh accordingly.

I have the same issue with my travis-ci build (https://travis-ci.org/kaklakariada/portmapper/builds/525556095). I use openjdk11 in .travis.yml.

Would be possible to download openjdk from https://adoptopenjdk.net/ instead of https://jdk.java.net? AdoptOpenJDK provides OpenJDK builds with LTS and security updates and has an provides an API for getting the latest versions.

Feels like a band-aid, @karussell – and I guess, Oracle will fix the underlying issue soon. So, I’ll delay applying a temporary workaround until … mid of the coming week.

For now, you may resort to the --url option of install-jdk.sh. Here you may specify a .tar.gz JDK of your choice. See https://github.com/sormuras/sormuras.github.io/blob/master/.travis.yml#L25-L47 for example usages. AdoptOpenJDK and others are supported.

@Travis-CI should really provide (more) “pre-installed” Java versions. Like they do with their XENIAL distro. openjdk10 and openjdk11 don’t rely on install-jdk.sh: https://docs.travis-ci.com/user/reference/xenial/#jvm-clojure-groovy-java-scala-support

My initial motivation for writing install-jdk.sh was to get a handle to the latest and greatest EA version of OpenJDK. Those EA versions are updated every week or two, thus it makes sense to download and install it “on-the-fly”. JDK versions that are GA or even archived should be downloaded and installed once and used many times.

Good to know, Thomas.

But still, I consider this an issue of “other parties”: Oracle/java.net and Travis CI. And it shows, that moving JUnit 5 CI builds to @microsoft 's Azure Pipelines was a good move. /cc @brunoborges

Perhaps, users of Travis CI should resort to use raw install-jdk.sh for now. With that, you’re able to select “every” .tar.gz JDK distribution out there. Something like the following .travis.yml scaffold loading AdoptOpenJDK 12 (hotspot):

language: java

before_script:
- wget https://github.com/sormuras/bach/raw/master/install-jdk.sh
- source install-jdk.sh --url 'https://api.adoptopenjdk.net/v2/binary/releases/openjdk12?openjdk_impl=hotspot&os=linux&arch=x64&release=latest&heap_size=normal&type=jdk'
- java --version

@kaklakariada In your case, i.e. when only using openjdk11 at Travis CI, I recommend using dist: xenial and not specifying a jdk. You’ll get openjdk11 by default. See https://github.com/sormuras/bach/blob/a962824b95231a27c9a11d55ff946038a7490ec7/.travis.yml for an example.

The following temporary workaround in install-jdk.sh seems to make it:

-    local DOWNLOAD='https://download.java.net/java'
+    local DOWNLOAD='https://download.oracle.com/java'