# Build randomly using jdk 13 despite osx\_image: xcode10.1

**URL:** <https://travis-ci.community/t/build-randomly-using-jdk-13-despite-osx-image-xcode10-1/6085>\
**Category:** macOS\
**Tags:** build-env, java, bug\
**Created:** [November 22, 2019, 11:35am UTC](https://travis-ci.community/t/build-randomly-using-jdk-13-despite-osx-image-xcode10-1/6085 "2019-11-22T11:35:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jcharlet](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/jcharlet/32/3212_2.png) [@jcharlet](https://travis-ci.community/u/jcharlet)\
**Post date:** [November 22, 2019, 11:35am UTC](https://travis-ci.community/t/build-randomly-using-jdk-13-despite-osx-image-xcode10-1/6085/1 "2019-11-22T11:35:13Z")

</div>

Hi,  
having the same issue as [Build randomly using jdk 13](https://travis-ci.community/t/build-randomly-using-jdk-13/5636) but I do specify `osx_image: xcode10.1` as suggested there.

`xcode10.1` provides jdk 13 instead of 11 as per [https://docs.travis-ci.com/user/reference/osx/](https://docs.travis-ci.com/user/reference/osx/) .

[https://travis-ci.org/digital-preservation/droid/jobs/615493055](https://travis-ci.org/digital-preservation/droid/jobs/615493055)  
config:

```auto
    - os: osx
      osx_image: xcode10.1

```

log:

```auto
$ java -Xmx32m -version
openjdk version "13.0.1" 2019-10-15
OpenJDK Runtime Environment (build 13.0.1+9)
OpenJDK 64-Bit Server VM (build 13.0.1+9, mixed mode, sharing)

```

build error:

```auto
Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 57

```

tried emptying the cache and restart the job with no success.

---

<div class="post-metadata">

**Author:** ![spoltier](https://avatars.discourse-cdn.com/v4/letter/s/f05b48/32.png) [@spoltier](https://travis-ci.community/u/spoltier)\
**Post date:** [December 4, 2019, 1:00pm UTC](https://travis-ci.community/t/build-randomly-using-jdk-13-despite-osx-image-xcode10-1/6085/2 "2019-12-04T13:00:42Z")

</div>

I have the same issue - here’s one of the failing builds: [https://travis-ci.org/miraisolutions/xlconnect/jobs/620558248](https://travis-ci.org/miraisolutions/xlconnect/jobs/620558248)

Towards the end of the _Build system information_ section, the jdk version is displayed:

```auto
Java version: 13.0.1, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/openjdk-13.0.1.jdk/Contents/Home

```

(I’m also using `xcode10.1`)

As was apparently done for the above build, a possible workaround is to switch to `xcode9.4`.

I’m not sure how long that will remain the case, however. I’m assuming since there was a change that these are not immutable images, and that they may be rebuilt and get the newer java version as a result ?

---

<div class="post-metadata">

**Author:** ![spoltier](https://avatars.discourse-cdn.com/v4/letter/s/f05b48/32.png) [@spoltier](https://travis-ci.community/u/spoltier)\
**Post date:** [December 18, 2019, 9:31am UTC](https://travis-ci.community/t/build-randomly-using-jdk-13-despite-osx-image-xcode10-1/6085/3 "2019-12-18T09:31:26Z")

</div>

Update: indeed, the `xcode9.4` image is now also affected and uses java 13. I don’t think it’s reasonable to expect any macOs testing to rely on the latest, just-released (non-LTS!) JDK version.  
Edit - build example: [https://travis-ci.org/miraisolutions/xlconnect/jobs/626577971](https://travis-ci.org/miraisolutions/xlconnect/jobs/626577971)

---

<div class="post-metadata">

**Author:** ![avdv](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/avdv/32/3214_2.png) [@avdv](https://travis-ci.community/u/avdv)\
**Post date:** [April 30, 2020, 6:18am UTC](https://travis-ci.community/t/build-randomly-using-jdk-13-despite-osx-image-xcode10-1/6085/4 "2020-04-30T06:18:00Z")

</div>

Yeah, I fell into this trap too. And still no solution / reaction here?!

My build failed because JDK 13 was used instead of the documented 10.0 for the default xcode9.4 image.

What is the deal here?
