Jdk_switcher: command not found

As the issue described, I added source ~/.jdk_switcher_rc or source /opt/jdk_switcher/jdk_switcher.sh in my Travis yml,but it shows that there’s no such file, here is my project: https://github.com/apache/rocketmq,
and it’s the travis detail: https://travis-ci.org/apache/rocketmq/builds/529579187?utm_source=github_status&utm_medium=notification

Please help me

1 Like

This is unfortunately unanswered after 2+ months.

I fear you may have read this request as “user has some weird configuration and it’s too hard to work out so let’s deprioritize it”

So I went to open an issue at GitHub since the following is, in my opinion, at minimum confirmed documentation bugs and I have minimal reproducible steps below. But GitHub issues referred to the forum instead. So these bugs should not be filed?

The following should be clear I hope:

This simple file:

Causes this result:
https://travis-ci.org/gunnarx/travis_java_test/builds/563544563

Bug report(s) (2):

script:
   - jdk_switcher use 

Expected result: jdk_switcher works as documented.
Result: jdk_switcher: command not found

jdk_switcher is documented here:
https://docs.travis-ci.com/user/languages/java/


For the same example:

script:
   - java -version

Expected result: Java version is 8
Result: Java version is 11

The following page states that openjdk8 shall be the default on Xenial (and this is also what it is usual in any unmodified Ubuntu 16.04 system), so even the jdk: key should not be necessary here.
https://docs.travis-ci.com/user/reference/xenial

Note: The environment mentions leiningen using java version 11 but this might just be a secondary effect of the wrong java version being installed by default?

Please advise.

1 Like

Have you tried jdk_switcher with Trusty? Looks like it might work.

Coincidentally, I want to use install-jdk.sh, but it is only available with Xenial. The jdk_switcher doesn’t work in Xenial, but that’s ok. I only need install-jdk.sh, since I’m trying to use AdoptOpenJDK.

Imprint