Oracle JDK 11 (and 10) are pre-installed, not the OpenJDK builds

According to https://docs.travis-ci.com/user/reference/xenial/#jvm-clojure-groovy-java-scala-support “Pre-installed JVMs: openjdk10 , and openjdk11 .” should be available

But the logs show “11.0.1 (Oracle Corporation 11.0.1+13)”: https://travis-ci.com/sormuras/junit-platform-maven-plugin/builds/90727653#L403

Is this intended?

How do I select one of the pre-installed Java versions AND prevent the “install-jdk.sh” to kick in?

Seems like dropping the “jdk” element from the .travis.yaml file leads to an OpenJDK 11 installation.

Hm, the build log shows more oddities: https://travis-ci.com/sormuras/junit-platform-maven-plugin/builds/90817465

With having only language: java (no jdk) configured:

A simple “java -version” reports: openjdk version "11.0.1" 2018-10-16
https://travis-ci.com/sormuras/junit-platform-maven-plugin/builds/90817465#L452

A subsequent call of Maven reports: Java version: 11.0.1, vendor: Oracle Corporation
https://travis-ci.com/sormuras/junit-platform-maven-plugin/builds/90817465#L464

Also, when I pass jdk: openjdk8, the default JDK remains openjdk11. The openjdk-8-jdk package does get installed, but it is overridden in $PATH by /usr/local/lib/jvm/openjdk11/bin, and $JAVA_HOME remains set to /usr/local/lib/jvm/openjdk11.

For now I’m working around this by fixing the environment variables:

PATH=$(echo "$PATH" | sed -e 's/:\/usr\/local\/lib\/jvm\/openjdk11\/bin//')
JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64
1 Like

Same issue here. if I set openjdk8 the build still executes on java11

jdk:
 - openjdk8

Executes as
Java version: 11.0.1, vendor: Oracle Corporation, runtime: /usr/local/lib/jvm/openjdk11

Is someone from Travis monitoring this or should be we opening an issue with support as well?

Hi everyone,

Sorry for the delay here.

I confirm this issue is currently tracked internally on our side. We’ll update this thread when it’s fixed and the change is in production.

Thank you for your patience!

3 Likes

Hi @dominic Any updates on this issue?

Hey @umayrh, we did some changes around JDK installation in the first half of December. To have a better understanding of your situation, could you post a link to a recent build still exhibiting the behavior described in the beginning? Thanks!

Hope that you can help me fixed this.thank you

OK sir thank you

Hi @dominic Here’s the Travis build failure https://travis-ci.org/umayrh/sketchy-polytopes/builds/472881092

Even though .travis.yaml specifies oraclejdk8, Java 11 is installed, which, being incompatible with Neo4j, causes Neo4j installation error.

@dominic any progress on this issue? One of my builds is failing due to being run with Java 11 when I specified openjdk8, but curiously enough only when reaching the script stage - checking the java version in the install stage correctly reports Java 8, but when in the script stage it reports Java 11.

Here’s the failed build: https://travis-ci.org/icatproject/icat.server/jobs/478408798

Sorry for the delay of my reply, @umayrh!

I had a look at your build and what happens is that you specify language: generic and, because of this, the jdk: key won’t be taken into account. Sorry for the inconvenience.

For jdk: to be read, you’ll need to specify language: java.

My hunch is that this was working with dist: trusty because the pre-installed JDKs (and possibly other dependencies) met your requirements.

Hope this helps!

Sorry for the delay of my reply as well, @louise-davies!

It seems this line

source ~/.bash_profile

is changing the default Java version from openjdk version "1.8.0_181" to openjdk version "11.0.1" 2018-10-16.

Could you tell us why you are sourcing .bash_profile there?

Thanks!

Dominic, what do we do in the case where we’re, say, using:

language: scala

but want:

jdk:
- oraclejdk8

to work properly?

I’m getting:

Expected feature release number in range of 9 to 13, but got: 8

Here’s an example:
https://travis-ci.org/gemini-hlsw/ocs/builds/526570188

1 Like

@sraaphorst This should work by adding dist: trusty to your .travis.yml file. Is this an option for you?

1 Like

? In our project we had to switch to xenial because of some Python dependencies but then Oracle JDK 8 installed fails with the above mentioned error. Had switched to OpenJDK 8 however I am baffled as to what is the technical difficulty of making oraclejdk8 work on xenial.

1 Like

I am having similar issue , while using Language as Java . here is my .travis.yml config
language: java
jdk: oraclejdk8
but I am still getting the following error
Expected feature release number in range of 9 to 14, but got: 8 The command "~/bin/install-jdk.sh --target "/home/travis/oraclejdk8" --workspace "/home/travis/.cache/install-jdk" --feature "8" --license "BCL"" failed and exited with 3 during .

1 Like

@sraaphorst, @Rahulyelamareddy, yours is a different issue, OracleJDK 7 not supported on Precise? , not what @sormuras reported.