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

openjdk6 on trusty no longer works #9713

Closed
lrytz opened this Issue Jun 7, 2018 · 7 comments

Comments

Projects
None yet
6 participants
@lrytz

lrytz commented Jun 7, 2018

#8199 (comment) shows how to enable openjdk6 on trusty:

addons:
  apt:
    packages:
      - openjdk-6-jdk

jdk: openjdk6

This used to work (on trusty), but no longer does. For example

In both cases, travis seems to run jdk_switcher use openjdk6 before installing the apt package, and the logs say

$ jdk_switcher use openjdk6
Switching to OpenJDK6 (java-1.6.0-openjdk-amd64), JAVA_HOME will be set to /usr/lib/jvm/java-6-openjdk-amd64
update-java-alternatives: directory does not exist: /usr/lib/jvm/java-1.6.0-openjdk-amd64

This behavior was also noted in #8206 (comment) in August 2017.

The sbt build tool shows the followign message (in the second build log):

Warning: Java version mismatch between PATH and JAVA_HOME/JDK_HOME, sbt will use the one in PATH
  Either: fix your PATH, remove JAVA_HOME/JDK_HOME or use -java-home
  java version from PATH:               8
  java version from JAVA_HOME/JDK_HOME: 6

I found the following workaround

  • add sudo: required
  • run jdk_switcher use openjdk6 in the build script before using java

SethTisue added a commit to SethTisue/scala-parser-combinators that referenced this issue Jun 9, 2018

@SethTisue

This comment has been minimized.

SethTisue commented Jun 9, 2018

run jdk_switcher use openjdk6 in the build script before using java

if your matrix includes other JVM versions, you'll need a conditional like:

if [[ $JAVA_HOME = *java-6* ]]; then jdk_switcher use openjdk6; fi
@eed3si9n

This comment has been minimized.

eed3si9n commented Jun 11, 2018

I am switching to jabba - sbt/launcher#56

lrytz added a commit to lrytz/scala-collection-compat that referenced this issue Jun 13, 2018

lrytz added a commit to lrytz/scala-collection-compat that referenced this issue Jun 13, 2018

@eed3si9n eed3si9n referenced this issue Jun 20, 2018

Closed

sbt does not work on openjdk7 #4219

1 of 1 task complete
@fancywriter

This comment has been minimized.

fancywriter commented Jul 20, 2018

Experience the same issue. Do you have any update on that?

@stale

This comment has been minimized.

stale bot commented Oct 18, 2018

Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue in 7 days. 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 respond before the issue is closed, or open a new one after. 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 Oct 18, 2018

@eed3si9n

This comment has been minimized.

eed3si9n commented Oct 18, 2018

Since I am using all your JDKs on Travis CI using jabba workaround, I don't need to rely on jdk_switcher.

The problem is that the jdk_switcher use openjdk6 not failing the build:

$ jdk_switcher use openjdk6
Switching to OpenJDK6 (java-1.6.0-openjdk-amd64), JAVA_HOME will be set to /usr/lib/jvm/java-6-openjdk-amd64
update-java-alternatives: directory does not exist: /usr/lib/jvm/java-1.6.0-openjdk-amd64

If the build passes on JDK 8, we may never notice that the CI did not run on OpenJDK6. This could have unintended consequences. It's understandable to say openjdk6 is no longer supported. Please fail the build in those cases.

@stale stale bot removed the stale label Oct 18, 2018

@dwijnand

This comment has been minimized.

dwijnand commented Oct 19, 2018

Does anyone at Travis CI know if this might be fixed by updating to a version of jdk_switcher that includes this fix?

@BanzaiMan BanzaiMan added the java label Oct 22, 2018

@BanzaiMan

This comment has been minimized.

Member

BanzaiMan commented Nov 13, 2018

The issue is that Java 6 is no longer pre-installed in the newer Trusty images, so jdk_switcher use … is not effective. As @eed3si9n mentioned, if you need it, you'll have to explicitly invoke it after apt addon has run.

dist: trusty
language: java

addons:
  apt:
    packages:
      - openjdk-6-jdk

jdk: openjdk6

before_install:
  - jdk_switcher use openjdk6
  

@BanzaiMan BanzaiMan closed this Nov 13, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment