"Expected feature release number in range of 9 to 12, but got: 8" installing oraclejdk8

I suddenly start getting this error

Expected feature release number in range of 9 to 12, 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 .

when travis tries to build my project Travis CI - Test and Deploy with Confidence.

My .travis.yml can be found here. https://github.com/IEnoobong/send-it-kotlin/blob/master/.travis.yml Kindly look into, advice and fix

Hello, there. I think this is due to a recent fix, where JDKs not pre-installed on Xenial are now correctly identified and installed. Notice that, in your previously-passing build, you are using Java 11, even though you specified oraclejdk8.

I suggest moving to a more recent JDK, or use Trusty instead.

Thanks for your response.

It’s sad that a fix would break previously passing projects.

How can I continue to use oraclejdk8? That’s what I use locally and in deployment

I can’t use Trusty because my test fails on it https://travis-ci.org/IEnoobong/send-it-kotlin/builds/459398544 but passes with Xenial https://travis-ci.org/IEnoobong/send-it-kotlin/builds/459406984

Trusty seems to be affected too: https://travis-ci.org/junit-team/junit4/jobs/466439918
Here it tries to install openjdk6 via install-jdk.sh

…I should rename it to install-jdk-ea.sh one day. :slight_smile:

Related issue https://github.com/junit-team/junit4/issues/1577

The passing build used Java 11, not Java 8. I don’t think a false positive will help anyone.

Well that’s still because Travis decided to ignore the jdk that was specified.

Please how can I ensure/force the use oraclejdk8?

I agree. And we fixed that.

Use Trusty. Your previous error on Trusty seems like an application error (one where it is returning 401 instead of 400). I do not believe it is affected by the change in Ubuntu distribution (Trusty vs Xenial) or Java version (8 vs 11).

Thanks for your response

Doesn’t look like a fix to me if it causes things to break, I think the fix would have been to respect the jdk specified in the .travis.yml. Is there any reason why Xenial should not to support oraclejdk8?

My previous error was due to this which when ahead to cause tests to return 401 Unauthorized rather than expected response. I spent lots of time investigating this issue as you can see in the number of commits made, which lead me to realizing the issue was with Trusty, all I had to do was change to Xenial and the tests passed. Authentication Providers usually come with the OS, but seems the version of Trusty you use is missing some upgrades, because spring couldn’t fine any Authentication Provider and your docs don’t recommend running apt upgrade

The difference between a test failure and a test passing was in changing the dist

Which brings me back to my question/request.

Please how can I ensure/force the use oraclejdk8 on Xenial?

Xenial’s pre-installed JDKs are 10 and 11. https://docs.travis-ci.com/user/reference/xenial#jvm-clojure-groovy-java-scala-support We do not support anything prior.

The link you shared says, pre-installed JDKs

  • Pre-installed JVMs: openjdk10 , and openjdk11 .

I’m trying to use OracleJDK not openJDK

Same link also says

  • Other JDKs, including Oracle’s, can be acquired if available by specifying jdk .

oraclejdk8 is available and I’m trying to acquire it by using specifying it in jdk but your so called fix is causing my build to fail by using a script that installs only JDK 9 - 12 which is causing builds all over to fail.

But yet it’s a fix ¯\(ツ)

Started a general “Java/JDK on Travis CI” thread here: Java/JDK on Travis CI

1 Like

@BanzaiMan I’ve not gotten any response from you

Kindly advice

My advice remains the same. Use Xenial or a newer JDK.

How can we solve this problem when we are using the xcode10.1 image? Unfortunately the build crashes when using jdk 11 and it is not being possible to use the jdk8. Also de jdk9 is crashing.

Since jdk8 is the most used one currently I think it will be a good idea to have support for it.

A possible workaround is to use openjdk8 instead of oraclejdk8. At least, this change made Travis CI green again in our build https://github.com/scalameta/mdoc/pull/171

@BanzaiMan To my best understanding, JDK 8 is still the most widely used JDK distribution (as of May 2019). Many open source libraries using Travis CI cannot upgrade to newer JDK versions since that would require downstream library users to upgrade their JDKs.

1 Like

yep, some library which I am using using is not compatible with oraclejdk > 8 so I needed to switch to openjdk also causing different problems. switching jdk has bottlenecks / is not trivial;

yep not allowing to use oraclejdk8 had broken my build

I’ve also had to do the workaround of falling back to Trusty to get Oracle JDK 8 working again. Oracle still supports Java 8 (they are maintaining it alongside newer versions) so please consider adding support for it again. The fact it still works in the Trusty environment shows it can be done.

1 Like