# JDK 8 and Maven missing in ARM64 despite \`jdk: openjdk8\`

**URL:** <https://travis-ci.community/t/jdk-8-and-maven-missing-in-arm64-despite-jdk-openjdk8/11450>\
**Category:** Multi CPU Architecture\
**Tags:** java, travis-build, arm64\
**Created:** [April 13, 2021, 8:03am UTC](https://travis-ci.community/t/jdk-8-and-maven-missing-in-arm64-despite-jdk-openjdk8/11450 "2021-04-13T08:03:30Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![native-api](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/native-api/32/430_2.png) [@native-api](https://travis-ci.community/u/native-api)\
**Post date:** [April 14, 2021, 5:13pm UTC](https://travis-ci.community/t/jdk-8-and-maven-missing-in-arm64-despite-jdk-openjdk8/11450/12 "2021-04-14T17:13:17Z")

</div>

I’ve confirmed the problem. For some reason, JDK 8 cannot install in an ARM64 builder.

Until the problem is solved, you can work around it by adding this to your `.travis.yml` (before any other commands in the `before_install:` section if you already have one):

```auto
before_install:
  - |
    if [[$TRAVIS_CPU_ARCH == "arm64"]]; then
      travis_install_jdk_package() {

        local JAVA_VERSION
        JAVA_VERSION="$1"
        sudo apt-get update -y
        PACKAGE="adoptopenjdk-${JAVA_VERSION}-hotspot"
        if ! dpkg -s "$PACKAGE" >/dev/null 2>&1; then
          if dpkg-query -l adoptopenjdk* ; then
            dpkg-query -l adoptopenjdk* | grep adoptopenjdk | awk '{print $2}' | xargs sudo dpkg -P
          fi
          wget -nv -O - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | sudo apt-key add -
          sudo add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/
          sudo apt-get update -yq
          sudo apt-get -yq --no-install-suggests --no-install-recommends install "$PACKAGE" || true
          sudo update-java-alternatives -s "$PACKAGE"*
          if ! dpkg-query -l maven &>/dev/null; then sudo apt-get -yq install maven; fi
        fi
      }
      travis_install_jdk_package 8
    fi

```

---

_[View the full topic](https://travis-ci.community/t/jdk-8-and-maven-missing-in-arm64-despite-jdk-openjdk8/11450)._
