# Install-jdk.sh failing for openjdk9 and 10

**URL:** <https://travis-ci.community/t/install-jdk-sh-failing-for-openjdk9-and-10/3998>\
**Category:** Java\
**Tags:** bug\
**Created:** [July 2, 2019, 2:02am UTC](https://travis-ci.community/t/install-jdk-sh-failing-for-openjdk9-and-10/3998 "2019-07-02T02:02:33Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![jayvdb](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/jayvdb/32/1966_2.png) [@jayvdb](https://travis-ci.community/u/jayvdb)\
**Post date:** [July 2, 2019, 2:02am UTC](https://travis-ci.community/t/install-jdk-sh-failing-for-openjdk9-and-10/3998/1 "2019-07-02T02:02:33Z")

</div>

```auto
Installing openjdk10
$ export JAVA_HOME=~/openjdk10
$ export PATH="$JAVA_HOME/bin:$PATH"
$ ~/bin/install-jdk.sh --target "/home/travis/openjdk10" --workspace "/home/travis/.cache/install-jdk" --feature "10" --license "GPL" --cacerts
Ignoring license option: GPL -- using GPLv2+CE by default
install-jdk.sh 2019-07-01-BETA
Variables:
  feature = 10
  license = GPL
       os = linux-x64 // os_name=linux os_arch=x64
      url = https://api.adoptopenjdk.net/v2/binary/releases/openjdk10?type=jdk&os=linux&arch=x64&release=latest&heap_size=normal&openjdk_impl=hotspot
   status = 302
Downloading JDK from https://api.adoptopenjdk.net/v2/binary/releases/openjdk10?type=jdk&os=linux&arch=x64&release=latest&heap_size=normal&openjdk_impl=hotspot...
mv: cannot stat ‘/home/travis/openjdk10/lib/security/cacerts’: No such file or directory
The command "~/bin/install-jdk.sh --target "/home/travis/openjdk10" --workspace "/home/travis/.cache/install-jdk" --feature "10" --license "GPL" --cacerts" failed and exited with 1 during .

```

[https://travis-ci.org/coala/coala-bears/jobs/553065996](https://travis-ci.org/coala/coala-bears/jobs/553065996)

---

<div class="post-metadata">

**Author:** ![sormuras](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/sormuras/32/2770_2.png) [@sormuras](https://travis-ci.community/u/sormuras)\
**Post date:** [July 2, 2019, 6:10am UTC](https://travis-ci.community/t/install-jdk-sh-failing-for-openjdk9-and-10/3998/2 "2019-07-02T06:10:24Z")

</div>

Looks like the archive from AdoptOpenJDK doesn’t contain a `lib/security/cacerts` directory by default.

Tracking progress in [https://github.com/sormuras/bach/issues/60](https://github.com/sormuras/bach/issues/60)

---

<div class="post-metadata">

**Author:** ![florianmutter](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/florianmutter/32/2146_2.png) [@florianmutter](https://travis-ci.community/u/florianmutter)\
**Post date:** [July 2, 2019, 7:05am UTC](https://travis-ci.community/t/install-jdk-sh-failing-for-openjdk9-and-10/3998/3 "2019-07-02T07:05:19Z")

</div>

Is there an estimate when this will be fixed?

---

<div class="post-metadata">

**Author:** ![jayvdb](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/jayvdb/32/1966_2.png) [@jayvdb](https://travis-ci.community/u/jayvdb)\
**Post date:** [July 2, 2019, 8:55am UTC](https://travis-ci.community/t/install-jdk-sh-failing-for-openjdk9-and-10/3998/4 "2019-07-02T08:55:48Z")

</div>

How is [https://github.com/sormuras/bach/](https://github.com/sormuras/bach/) related?

It has only a single job

> <https://github.com/sormuras/bach/blob/dfbefaf/.travis.yml>

Is that in production on Travis CI? Or has my jobs been pushed to some alpha version of Travis.

---

<div class="post-metadata">

**Author:** ![nkorange](https://avatars.discourse-cdn.com/v4/letter/n/a587f6/32.png) [@nkorange](https://travis-ci.community/u/nkorange)\
**Post date:** [July 2, 2019, 9:27am UTC](https://travis-ci.community/t/install-jdk-sh-failing-for-openjdk9-and-10/3998/5 "2019-07-02T09:27:22Z")

</div>

Same error encountered by me. Is there any solution?

---

<div class="post-metadata">

**Author:** ![sormuras](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/sormuras/32/2770_2.png) [@sormuras](https://travis-ci.community/u/sormuras)\
**Post date:** [July 2, 2019, 9:52am UTC](https://travis-ci.community/t/install-jdk-sh-failing-for-openjdk9-and-10/3998/6 "2019-07-02T09:52:10Z")

</div>

> [@jayvdb](#):
>
> How is [GitHub - sormuras/bach: 🎼 Bach Builds (on(ly)) Modules](https://github.com/sormuras/bach/) related?

`install-jdk.sh` is hosted there, and Travis CI decided to use a copy of that script to install JDKs on-the-fly. See [Java: Switch to `bach` for installing and managing JDKs · Issue #976 · travis-ci/travis-cookbooks · GitHub](https://github.com/travis-ci/travis-cookbooks/issues/976) and related links.

> [@florianmutter](#):
>
> Is there an estimate when this will be fixed?

> [@nkorange](#):
>
> Same error encountered by me. Is there any solution?

Fixed `install-jdk.sh` already last night – Travis CI needs to update their copy the script.

/cc @BanzaiMan et al

---

<div class="post-metadata">

**Author:** ![sormuras](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/sormuras/32/2770_2.png) [@sormuras](https://travis-ci.community/u/sormuras)\
**Post date:** [July 2, 2019, 10:14am UTC](https://travis-ci.community/t/install-jdk-sh-failing-for-openjdk9-and-10/3998/7 "2019-07-02T10:14:38Z")

</div>

Having said that: JDK 9 and 10 “dead”, “end-of-life”, archived…

**Move to JDK 11 (LTS) or 12 (until September), please.**

---

<div class="post-metadata">

**Author:** ![BanzaiMan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/banzaiman/32/67_2.png) [@BanzaiMan](https://travis-ci.community/u/BanzaiMan)\
**Post date:** [July 2, 2019, 11:42am UTC](https://travis-ci.community/t/install-jdk-sh-failing-for-openjdk9-and-10/3998/8 "2019-07-02T11:42:10Z")

</div>

I’ve deployed `travis-build` again.

---

<div class="post-metadata">

**Author:** ![sormuras](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/sormuras/32/2770_2.png) [@sormuras](https://travis-ci.community/u/sormuras)\
**Post date:** [July 2, 2019, 11:54am UTC](https://travis-ci.community/t/install-jdk-sh-failing-for-openjdk9-and-10/3998/9 "2019-07-02T11:54:34Z")

</div>

Should work now without trying to copy non-existing cacerts directory.

---

<div class="post-metadata">

**Author:** ![nkorange](https://avatars.discourse-cdn.com/v4/letter/n/a587f6/32.png) [@nkorange](https://travis-ci.community/u/nkorange)\
**Post date:** [July 2, 2019, 1:31pm UTC](https://travis-ci.community/t/install-jdk-sh-failing-for-openjdk9-and-10/3998/10 "2019-07-02T13:31:33Z")

</div>

Still not working in my repository: [https://travis-ci.org/alibaba/nacos/jobs/553146511](https://travis-ci.org/alibaba/nacos/jobs/553146511)

---

<div class="post-metadata">

**Author:** ![jayvdb](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/jayvdb/32/1966_2.png) [@jayvdb](https://travis-ci.community/u/jayvdb)\
**Post date:** [July 2, 2019, 1:46pm UTC](https://travis-ci.community/t/install-jdk-sh-failing-for-openjdk9-and-10/3998/11 "2019-07-02T13:46:53Z")

</div>

> [@sormuras](#):
>
> Having said that: JDK 9 and 10 “dead”, “end-of-life”, archived…  
> Move to JDK 11 (LTS) or 12 (until September), please.

There is lots of very important software that is still stuck on JDK 7 and 8, and 9 and 10, and coala wraps them. I don’t get to choose the priorities of all our dependencies, and they are usually unfunded open source.

OpenJDK 9 and 10 were working last week.  
openjdk10 is listed many times on [Building a Java project - Travis CI](https://docs.travis-ci.com/user/languages/java/)

Only `oraclejdk10` is mentioned as not supported by Travis CI, and I hope that Travis CI will continue to have a pragmatic approach of continuing to provide unsupported versions long past their EOL, and not intentionally break stuff, or neglect to test and let them rot without a conscious decision that the support cost vs benefit is too high.

---

<div class="post-metadata">

**Author:** ![jayvdb](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/jayvdb/32/1966_2.png) [@jayvdb](https://travis-ci.community/u/jayvdb)\
**Post date:** [July 2, 2019, 1:50pm UTC](https://travis-ci.community/t/install-jdk-sh-failing-for-openjdk9-and-10/3998/12 "2019-07-02T13:50:30Z")

</div>

Also not working for me [https://travis-ci.org/coala/coala-bears/jobs/553187482](https://travis-ci.org/coala/coala-bears/jobs/553187482) (rebuild just now)

```auto
Installing openjdk10
$ export JAVA_HOME=~/openjdk10
$ export PATH="$JAVA_HOME/bin:$PATH"
$ ~/bin/install-jdk.sh --target "/home/travis/openjdk10" --workspace "/home/travis/.cache/install-jdk" --feature "10" --license "GPL" --cacerts
Ignoring license option: GPL -- using GPLv2+CE by default
install-jdk.sh 2019-07-02-II
Variables:
  feature = 10
  license = GPL
       os = linux-x64 // os_name=linux os_arch=x64
      url = https://api.adoptopenjdk.net/v2/binary/releases/openjdk10?type=jdk&os=linux&arch=x64&release=latest&heap_size=normal&openjdk_impl=hotspot
   status = 502
Downloading JDK from https://api.adoptopenjdk.net/v2/binary/releases/openjdk10?type=jdk&os=linux&arch=x64&release=latest&heap_size=normal&openjdk_impl=hotspot...
The command "~/bin/install-jdk.sh --target "/home/travis/openjdk10" --workspace "/home/travis/.cache/install-jdk" --feature "10" --license "GPL" --cacerts" failed and exited with 8 during .

```

---

<div class="post-metadata">

**Author:** ![BanzaiMan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/banzaiman/32/67_2.png) [@BanzaiMan](https://travis-ci.community/u/BanzaiMan)\
**Post date:** [July 2, 2019, 1:55pm UTC](https://travis-ci.community/t/install-jdk-sh-failing-for-openjdk9-and-10/3998/13 "2019-07-02T13:55:40Z")

</div>

It’s 502 from the server. [https://travis-ci.org/coala/coala-bears/jobs/553187482#L430](https://travis-ci.org/coala/coala-bears/jobs/553187482#L430)

---

<div class="post-metadata">

**Author:** ![jayvdb](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/jayvdb/32/1966_2.png) [@jayvdb](https://travis-ci.community/u/jayvdb)\
**Post date:** [July 2, 2019, 1:59pm UTC](https://travis-ci.community/t/install-jdk-sh-failing-for-openjdk9-and-10/3998/14 "2019-07-02T13:59:30Z")

</div>

Even oraclejdk11 is 502

[https://travis-ci.org/jayvdb/bach/builds/553307121](https://travis-ci.org/jayvdb/bach/builds/553307121)

---

<div class="post-metadata">

**Author:** ![BanzaiMan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/banzaiman/32/67_2.png) [@BanzaiMan](https://travis-ci.community/u/BanzaiMan)\
**Post date:** [July 2, 2019, 2:02pm UTC](https://travis-ci.community/t/install-jdk-sh-failing-for-openjdk9-and-10/3998/15 "2019-07-02T14:02:41Z")

</div>

We’ll have to wait for the services to be restored.

---

<div class="post-metadata">

**Author:** ![jayvdb](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/jayvdb/32/1966_2.png) [@jayvdb](https://travis-ci.community/u/jayvdb)\
**Post date:** [July 2, 2019, 2:28pm UTC](https://travis-ci.community/t/install-jdk-sh-failing-for-openjdk9-and-10/3998/16 "2019-07-02T14:28:08Z")

</div>

I see there is some testing of this install script using GitHub actions ; last run at [https://github.com/sormuras/bach/runs/160154663](https://github.com/sormuras/bach/runs/160154663)

And a quick read of the script suggests it always picks [Java.net](http://Java.net) for 13+ , and always picks AdoptJDK for 12 and lower.

> <https://github.com/sormuras/bach/blob/e244aaa/install-jdk.sh#L194>

If so, that will not be fixed by restoring services, whatever that means.

---

<div class="post-metadata">

**Author:** ![BanzaiMan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/banzaiman/32/67_2.png) [@BanzaiMan](https://travis-ci.community/u/BanzaiMan)\
**Post date:** [July 2, 2019, 3:23pm UTC](https://travis-ci.community/t/install-jdk-sh-failing-for-openjdk9-and-10/3998/17 "2019-07-02T15:23:39Z")

</div>

> [@jayvdb](#):
>
> If so, that will not be fixed by restoring services, whatever that means.

When the service on [api.adoptopenjdk.net](http://api.adoptopenjdk.net) is restored, I expect the script to work. Do you have reasons to believe otherwise?

---

<div class="post-metadata">

**Author:** ![jayvdb](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/jayvdb/32/1966_2.png) [@jayvdb](https://travis-ci.community/u/jayvdb)\
**Post date:** [July 3, 2019, 2:06am UTC](https://travis-ci.community/t/install-jdk-sh-failing-for-openjdk9-and-10/3998/18 "2019-07-03T02:06:52Z")

</div>

> [@BanzaiMan](#):
>
> When the service on [api.adoptopenjdk.net](http://api.adoptopenjdk.net) is restored, I expect the script to work. Do you have reasons to believe otherwise?

Yes, I do _not_ expect software to work correctly unless it has been tested adequately, and these days the _assurance_ that it was tested adequately for a purpose is initially its CI matrix and code coverage of its tests.

I’ve restarted [Travis CI - Test and Deploy with Confidence](https://travis-ci.org/coala/coala-bears/jobs/553187482) right now and the API is 302 but the result is still `ln: failed to create symbolic link ‘/home/travis/openjdk10/lib/security/cacerts’: No such file or directory`

As I indicated in earlier posts, bach & especially install-jdk.sh are not being QA’d on all jdk versions that Travis is expected to work. The GitHub action CI mentioned above only really hits the AdoptJDK API. It does not test the majority of the logic in `install-jdk.sh`. It only does `install-jdk.sh --dry-run`, which [`bales out`](https://github.com/sormuras/bach/blob/e244aaa/install-jdk.sh#L316) before the section of code which has the problems we are experiencing. And even if it had 100% test coverage, then it still needs additional QA for switching betwen jdk’s, as that is a completely different function point from adding a new jdk, and the ability switch jdk in an adhoc manner is sprinkled liberally through the Travis CI docs.

---

<div class="post-metadata">

**Author:** ![sormuras](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/sormuras/32/2770_2.png) [@sormuras](https://travis-ci.community/u/sormuras)\
**Post date:** [July 3, 2019, 3:53am UTC](https://travis-ci.community/t/install-jdk-sh-failing-for-openjdk9-and-10/3998/19 "2019-07-03T03:53:12Z")

</div>

> [@jayvdb](#):
>
> …the section of code which has the problems we are experiencing.

Moved the failing call to `ln` into the guarded block via [Don't link system CA certificates if target dir doesn't exist · sormuras/bach@c185fb8 · GitHub](https://github.com/sormuras/bach/commit/c185fb8aa2d406517228341e3d25168decb5b9ab) – version `2019-07-03` needs to be copied over to Travis CI. Again.

As stated here [https://github.com/travis-ci/travis-build/pull/1347#issuecomment-385885801](https://github.com/travis-ci/travis-build/pull/1347#issuecomment-385885801) and in various other places, the `install-jdk.sh` script was designed to just download and extract the latest-and-greatest JDK (from [jdk.java.net](http://jdk.java.net)) into a clean (CI) environment. Nothing more, nothing less.  
I (still) don’t want to support more complex scenarios within the script. There are better solutions available, but I don’t know how if/whether Travis CI may make use of them: http(s) caching proxy techniques like [http://www.squid-cache.org](http://www.squid-cache.org/) does is one option. The archived and released JDK URLs are very stable and **should be pre-installed within Travis CI images** , the EA releases change every 1-3 weeks. Supporting the latter was and is the main goal of `install-jdk.sh`.

Perhaps switching to a more complete Java Version Manager like [GitHub - shyiko/jabba: (cross-platform) Java Version Manager](https://github.com/shyiko/jabba) is an option (for archived/released JDKs) for Travis CI.

Cheers,  
Christian

---

<div class="post-metadata">

**Author:** ![jayvdb](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/jayvdb/32/1966_2.png) [@jayvdb](https://travis-ci.community/u/jayvdb)\
**Post date:** [July 3, 2019, 11:51am UTC](https://travis-ci.community/t/install-jdk-sh-failing-for-openjdk9-and-10/3998/20 "2019-07-03T11:51:13Z")

</div>

> [@sormuras](#):
>
> Nothing more, nothing less.

I appreciate your predicament, and that you are trying to get your tool working according to the needs of Travis CI, GmbH.

[Next page](https://travis-ci.community/t/install-jdk-sh-failing-for-openjdk9-and-10/3998.md?page=2)
