# 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:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![matthias-schn](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/matthias-schn/32/6454_2.png) [@matthias-schn](https://travis-ci.community/u/matthias-schn)\
**Post date:** [April 13, 2021, 8:03am UTC](https://travis-ci.community/t/jdk-8-and-maven-missing-in-arm64-despite-jdk-openjdk8/11450/1 "2021-04-13T08:03:30Z")

</div>

I am trying to a multiarch docker container with CICD using Travis ci  
Travis already creates and pushed the Container into Dockerhub → but only AMD64 and I want to run it on my Raspberry either.

What is the best way to do so?

```auto
#we use java
language: java
#we add the java development kit (jdk)
jdk:
- openjdk8

matrix:
  include:
    - os: linux
      dist: xenial
      arch: amd64
      jdk: openjdk8
    - os: linux
      dist: trusty
      arch: rpi
      jdk: openjdk8
      before_install:
        - sudo apt-get -yq install maven
  
os: linux
  
virt: vm

services:
#Linking Travis CI and Docker
- docker
before_install:
- mvn clean
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker pull openjdk:8-jdk-alpine
script:
#We avoid this error :" the job exceeded the maximum log length and has been terminated "
- cp .travis.settings.xml $HOME/.m2/settings.xml
- cat $HOME/.m2/settings.xml
#deploying the app on Docker
- mvn deploy

```

In my opinion I’d have to change something in `mvn deploy` but I can’t find anything like that on Google

I hope someone can help me!  
Matthias

---

<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 13, 2021, 11:02am UTC](https://travis-ci.community/t/jdk-8-and-maven-missing-in-arm64-despite-jdk-openjdk8/11450/6 "2021-04-13T11:02:45Z")

</div>

> **[Travis CI Documentation](https://docs.travis-ci.com/user/multi-cpu-architectures/#testing-on-multiple-cpu-architectures)**
>
> Building on Multiple CPU Architectures

> [@matthias-schn](#):
>
> arch:rpi

There’s no such thing as “`arch:rpi`”. See the documentation page for valid values.

See if there are any warnings or errors on the “config” tab of the build page.  
Also check your `.travis.yml` at [https://config.travis-ci.com/explore](https://config.travis-ci.com/explore) to see the intended resulting build matrix.

Please link to a build for me to be able to say anything else.

---

<div class="post-metadata">

**Author:** ![matthias-schn](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/matthias-schn/32/6454_2.png) [@matthias-schn](https://travis-ci.community/u/matthias-schn)\
**Post date:** [April 13, 2021, 6:01pm UTC](https://travis-ci.community/t/jdk-8-and-maven-missing-in-arm64-despite-jdk-openjdk8/11450/9 "2021-04-13T18:01:52Z")

</div>

Are you able to access this link?: [Travis CI - Test and Deploy with Confidence](https://travis-ci.com/github/Fabe278/EinboeckManualAPI)

The `.travis.yml` thing looks like this:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/travis_ci/original/2X/5/5e5c4b4e066c4312ff98799ae2405ecfa99d66c2.png)

Oh sorry I forgot to link the docker repo… Here it is: [Docker Hub](https://hub.docker.com/r/fabianhainzinger/einboeck-manual-api/tags?page=1&ordering=last_updated)  
As you can see in the ‘Tags’ Tab there is only amd64

Do you mean the `.travis.yml` file?

---

<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

```

---

<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 16, 2021, 6:37am UTC](https://travis-ci.community/t/jdk-8-and-maven-missing-in-arm64-despite-jdk-openjdk8/11450/19 "2021-04-16T06:37:47Z")

</div>

Split this topic on April 16, 2021, 6:37am UTC

2 posts were split to a new topic: [Only AMD64 Docker image is uploaded to Docker Hub despite deploying in 2 architectures](https://travis-ci.community/t/only-amd64-docker-image-is-uploaded-to-docker-hub-despite-deploying-in-2-architectures/11468)

---

<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 16, 2021, 12:14pm UTC](https://travis-ci.community/t/jdk-8-and-maven-missing-in-arm64-despite-jdk-openjdk8/11450/20 "2021-04-16T12:14:55Z")

</div>

Split this topic on April 16, 2021, 12:14pm UTC

A post was merged into an existing topic: [Only AMD64 Docker image is uploaded to Docker Hub despite deploying in 2 architectures](https://travis-ci.community/t/only-amd64-docker-image-is-uploaded-to-docker-hub-despite-deploying-in-2-architectures/11468/3)
