# Old java version in bionic

**URL:** <https://travis-ci.community/t/old-java-version-in-bionic/4726>\
**Category:** Bionic\
**Created:** [August 14, 2019, 4:18pm UTC](https://travis-ci.community/t/old-java-version-in-bionic/4726 "2019-08-14T16:18:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![paschty](https://avatars.discourse-cdn.com/v4/letter/p/a88e57/32.png) [@paschty](https://travis-ci.community/u/paschty)\
**Post date:** [August 14, 2019, 4:18pm UTC](https://travis-ci.community/t/old-java-version-in-bionic/4726/1 "2019-08-14T16:18:18Z")

</div>

I added this lines to before\_install:

- sudo apt-get update
- sudo apt-get upgrade
- java -version

The output is:  
java -version  
openjdk version “11.0.2” 2019-01-15  
OpenJDK Runtime Environment 18.9 (build 11.0.2+9)  
OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)

If i run this command on our production server, then i get:  
/usr/lib/jvm/java-11-openjdk-amd64/bin/java -version  
openjdk version “11.0.4” 2019-07-16

I would expect to have the same java version in travis.

I think there is a bug in the Version 11.0.2 which causes our build to fail.

Build url: [https://travis-ci.org/MyCoRe-Org/mycore/builds/571887611](https://travis-ci.org/MyCoRe-Org/mycore/builds/571887611)

---

<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:** [August 14, 2019, 5:32pm UTC](https://travis-ci.community/t/old-java-version-in-bionic/4726/2 "2019-08-14T17:32:14Z")

</div>

When reporting problems, please point to relevant build URLs. Thanks.

---

<div class="post-metadata">

**Author:** ![paschty](https://avatars.discourse-cdn.com/v4/letter/p/a88e57/32.png) [@paschty](https://travis-ci.community/u/paschty)\
**Post date:** [August 15, 2019, 7:59am UTC](https://travis-ci.community/t/old-java-version-in-bionic/4726/3 "2019-08-15T07:59:40Z")

</div>

The relevant build url is: [https://travis-ci.org/MyCoRe-Org/mycore/builds/571887611](https://travis-ci.org/MyCoRe-Org/mycore/builds/571887611)

---

<div class="post-metadata">

**Author:** ![vorburger](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/vorburger/32/2096_2.png) [@vorburger](https://travis-ci.community/u/vorburger)\
**Post date:** [May 8, 2020, 9:16pm UTC](https://travis-ci.community/t/old-java-version-in-bionic/4726/4 "2020-05-08T21:16:29Z")

</div>

We hit a similar problem and we needed OpenJDK 11.0.3 or later (in our case due to [https://bugs.openjdk.java.net/browse/JDK-8212885](https://bugs.openjdk.java.net/browse/JDK-8212885)), and like you also noticed that Travis CI seems to be eternally stuck on 11.0.2 … 😿

In [https://issues.apache.org/jira/browse/FINERACT-937](https://issues.apache.org/jira/browse/FINERACT-937), we gathered that this is because [https://github.com/travis-ci/travis-cookbooks/blob/master/cookbooks/travis\_jdk/files/install-jdk.sh#L200](https://github.com/travis-ci/travis-cookbooks/blob/master/cookbooks/travis_jdk/files/install-jdk.sh#L200) is hard-coded to 11.0.2.

We managed to work around this by wiping Travis’ (bad, old, outdated) JDK, and just installing our own; see [https://github.com/apache/fineract/pull/846](https://github.com/apache/fineract/pull/846) for exactly how we did that.

I’ve also posted a Feature Request for this on [Use (latest) Java point versions from Ubuntu packages, instead of hard-coding old fix versions from java.net in install-jdk.sh](https://travis-ci.community/t/use-latest-java-point-versions-from-ubuntu-packages-instead-of-hard-coding-old-fix-versions-from-java-net-in-install-jdk-sh/8518)

---

<div class="post-metadata">

**Author:** ![rhanton](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/rhanton/32/5110_2.png) [@rhanton](https://travis-ci.community/u/rhanton)\
**Post date:** [November 24, 2021, 7:07am UTC](https://travis-ci.community/t/old-java-version-in-bionic/4726/5 "2021-11-24T07:07:28Z")

</div>

Thanks for the help @vorburger - I had a similar issue and this workaround you suggest worked quite well. Not sure why TravisCI can’t fix this problem.
