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

openjdk6 builds failed with "NB: JAVA_HOME should point to a JDK not a JRE" #8452

Closed
shuaichang opened this issue Sep 18, 2017 · 2 comments
Closed

Comments

@shuaichang
Copy link

shuaichang commented Sep 18, 2017

Recent openjdk6 builds failed with below messages, one example https://travis-ci.org/aliyun/fc-java-sdk/jobs/276211613, java -Xmx32m -version shows java 1.8. I saw a similar issue #8423 that was closed as a duplicate of #7884, but that only mentioned switching from oraclejdk7 to openjdk7.

Any idea what happened to openjdk6?

$ export PATH=$JAVA_HOME/bin:$PATH
$ java -Xmx32m -version
Picked up _JAVA_OPTIONS: -Xmx2048m -Xms512m
java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)
$ javac -J-Xmx32m -version
Picked up _JAVA_OPTIONS: -Xmx2048m -Xms512m
javac 1.8.0_144
0.02s$ mvn clean package install -DskipTests -Dgpg.skip
The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME should point to a JDK not a JRE
@shuaichang
Copy link
Author

shuaichang commented Sep 18, 2017

Seems openjdk6 is not coming along with trusty VM as described in #8199 (comment)

After adding addon openjdk6, the build will be likely to fail with Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/maven/cli/MavenCli : Unsupported major.minor version 51.0, which is caused by newer version Maven is incompatible with openjdk6, using an older version of Maven could fix the issue

To make everything working, below travis config can be helpful, credit: travis-ci/enterprise-installation#14 (comment)

language: java

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

jdk:
  - openjdk6
  - openjdk7
  - oraclejdk8

install:
  - echo "Downloading Maven 3.0";
  - wget https://archive.apache.org/dist/maven/binaries/apache-maven-3.0-bin.zip || travis_terminate 1
  - unzip -qq apache-maven-3.0-bin.zip || travis_terminate 1
  - export M2_HOME=$PWD/apache-maven-3.0
  - export PATH=$M2_HOME/bin:$PATH
  - mvn -version
  - mvn clean package install -DskipTests -Dgpg.skip
script:
  - mvn test

@shuaichang
Copy link
Author

Closing

DiegoPino added a commit to DiegoPino/islandora_drupal_filter that referenced this issue Oct 2, 2017
DiegoPino added a commit to DiegoPino/islandora_drupal_filter that referenced this issue Oct 2, 2017
apetkau added a commit to apetkau/galaxy-bootstrap that referenced this issue Nov 8, 2017
davidstaheli pushed a commit to microsoft/Git-Credential-Manager-for-Mac-and-Linux that referenced this issue May 7, 2018
* Support Java 9+

There was a change made to the oauth2-useragent dependency to fix an
issue with parsing newer versions of Java. This change updates to that
newer version to include the fix.

Additionally, it appears javax.xml.bind is no longer included with Java
9. This has been included as a maven dependency to resolve class def
errors once the oauth2-useragent error was resolved.

* Attempt to load jdk6

* Version of maven is incompatible with jdk6

Need to use an older version of maven if it will use jdk6.

Relevant issue on Github for Travis: travis-ci/travis-ci#8452

* Closer version to the last green build.

* Build with jdk7
raghuhit added a commit to browserstack/browserstack-local-java that referenced this issue May 30, 2018
Travis has removed openjdk6 for saving space, hence adding it from addon and the version of maven which is by default used in travis  requires minimum jdk7, hence installing specific version of maven.

For more info refer : 
https://docs.travis-ci.com/user/reference/trusty/#jvm-clojure-groovy-java-scala-images
travis-ci/travis-ci#8452
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant