Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List of supported JVMs on Ubuntu Focal incorrect (OpenJDK 8 unsupported) #2902

Open
joschi opened this issue Oct 22, 2020 · 9 comments
Open
Labels

Comments

@joschi
Copy link

joschi commented Oct 22, 2020

According to the documentation about the Ubuntu 20.04 (Focal Fossa) Build Environment, it should come with OpenJDK 8 preinstalled:

Pre-installed JVMs: openjdk8, openjdk10, and openjdk11 on x86, default is openjdk11.

https://docs.travis-ci.com/user/reference/focal/#jvm-clojure-groovy-java-scala-support
https://github.com/travis-ci/docs-travis-ci-com/blame/f6814e6281e1036b6ca056b49106cabcdc74e77e/user/reference/focal.md#L137

Unfortunately this is incorrect and only OpenJDK 9 and later seem to be supported:

$ ~/bin/install-jdk.sh --target "/home/travis/openjdk8" --workspace "/home/travis/.cache/install-jdk" --feature "8" --license "GPL" --cacerts
Ignoring license option: GPL -- using GPLv2+CE by default
install-jdk.sh 2020-06-02
Expected feature release number in range of 9 to 16, but got: 8
The command "~/bin/install-jdk.sh --target "/home/travis/openjdk8" --workspace "/home/travis/.cache/install-jdk" --feature "8" --license "GPL" --cacerts" failed and exited with 3 during .

Source: https://travis-ci.com/github/dropwizard/dropwizard/jobs/403800987#L170-L174

There is also an unanswered topic in the Travis CI Community about this:
https://travis-ci.community/t/openjdk8-setup-fails-on-focal/9760/2

Given that Java 8 is still in wide use, it would be great if support for OpenJDK 8 could be added to the Ubuntu 20.04 (Focal Fossa) Build Environment.

@sormuras
Copy link

Perhaps related to sormuras/bach#72?

@joschi
Copy link
Author

joschi commented Oct 22, 2020

@sormuras The message is a different one and the --feature seems to be checked before anything is being downloaded.

@sormuras
Copy link

Ah, ok.

install-jdk.sh shouldn't be called for JDK versions below 9 at all, and for 9 to 14 (as of today) only for non-production related tasks. See https://travis-ci.community/t/java-jdk-on-travis-ci/1380 for details.

@joschi
Copy link
Author

joschi commented Oct 22, 2020

install-jdk.sh shouldn't be called for JDK versions below 9 at all, and for 9 to 14 (as of today) only for non-production related tasks.

That's something which Travis CI has to fix or make very clear that OpenJDK 8 is not supported on the Ubuntu Focal build environment out of the box. 😉

@hnarayanan
Copy link

I understand that this is not working out of the box, but could someone point me to any working instructions on how to setup OpenJDK 8 on Focal. Nearly everything I've tried appears to be out-of-date documentation.

@joschi
Copy link
Author

joschi commented Dec 11, 2020

@hnarayanan
Copy link

Thank you. I went with a different approach and document the solution below in case it helps anyone. In the following example, I am trying to set up an older Java for an older elasticsearch. In .travis.yml:

before_install:
  - sudo apt-get install -y openjdk-8-jdk
before_script:
  - echo JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 | sudo tee -a /etc/default/elasticsearch

Alternatively you can just export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 or add it to your path before your scripts.

@stale
Copy link

stale bot commented Jan 9, 2022

Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please do feel free to either reopen this issue or open a new one. We'll gladly take a look again! You can read more here: https://blog.travis-ci.com/2018-03-09-closing-old-issues

@stale stale bot added the stale label Jan 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants