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

Openjdk 17 makes compilation fails because not installed in centos 7. #808

Closed
victorpablosceruelo opened this issue May 18, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@victorpablosceruelo
Copy link
Contributor

Describe the bug
When compiling quickstarters in pipeline, it fails because openjdk 17 is not available.
The package is not installed during docker build, but only a warning is shown.
Change to jdk 17 (script use-j17.sh) is not able to switch, but it just shows a warning
When maven tries to compile, an error is shown.

To Reproduce
Steps to reproduce the behavior:
Provision a spring-boot quickstarter in an ods-box and try to build the component.

Expected behavior
Installation of jdk 17 succeeds and compilation too.

Screenshots

Affected version (please complete the following information):

  • OpenShift: [3.11]
  • OpenDevStack [4.x]

Log Output (ensure to remove any confidential information like tokens, project names, etc.

Installation warning messages:

 amazon-ebs: Loaded plugins: fastestmirror, ovl
15:04:08      amazon-ebs: Loading mirror speeds from cached hostfile
15:04:08      amazon-ebs:  * base: download.cf.centos.org
15:04:08      amazon-ebs:  * centos-sclo-rh: download.cf.centos.org
15:04:08      amazon-ebs:  * epel: d2lzkl7pfhq30w.cloudfront.net
15:04:08      amazon-ebs:  * extras: download.cf.centos.org
15:04:08      amazon-ebs:  * updates: download.cf.centos.org
15:04:10      amazon-ebs: repo id                                                repo name          status
15:04:10      amazon-ebs: base/7/x86_64                                          CentOS-7 - Base    10072
15:04:10      amazon-ebs: cbs-paas7-openshift-multiarch-el7-build/x86_64         CBS OpenShift Mult 10420
15:04:10      amazon-ebs: centos-sclo-rh/x86_64                                  CentOS-7 - SCLo rh  7863
15:04:10      amazon-ebs: copr:copr.fedorainfracloud.org:alsadi:dumb-init/x86_64 Copr repo for dumb     3
15:04:10      amazon-ebs: epel/x86_64                                            Extra Packages for 13756
15:04:10      amazon-ebs: extras/7/x86_64                                        CentOS-7 - Extras    509
15:04:10      amazon-ebs: updates/7/x86_64                                       CentOS-7 - Updates  3773
15:04:10      amazon-ebs: repolist: 46396
15:04:10      amazon-ebs: Loaded plugins: fastestmirror, ovl
15:04:10      amazon-ebs: Loading mirror speeds from cached hostfile
15:04:10      amazon-ebs:  * base: download.cf.centos.org
15:04:10      amazon-ebs:  * centos-sclo-rh: download.cf.centos.org
15:04:10      amazon-ebs:  * epel: d2lzkl7pfhq30w.cloudfront.net
15:04:10      amazon-ebs:  * extras: download.cf.centos.org
15:04:10      amazon-ebs:  * updates: download.cf.centos.org
15:04:11      amazon-ebs: No package java-17-openjdk-devel available.
15:04:11      amazon-ebs: No package java-17-openjdk-jmods available.

Switch to openjdk 17 warning messages:

15:05:00      amazon-ebs: Switching to java 17:
15:05:00      amazon-ebs: /usr/lib/jvm//bin/java has not been configured as an alternative for java
15:05:00      amazon-ebs: Picked up JAVA_TOOL_OPTIONS: -XX:+UnlockExperimentalVMOptions -Dsun.zip.disableMemoryMapping=true
15:05:00      amazon-ebs: javac 1.8.0_332
15:05:00      amazon-ebs: Switching to java 11:
15:05:00      amazon-ebs: Picked up JAVA_TOOL_OPTIONS: -XX:+UnlockExperimentalVMOptions -Dsun.zip.disableMemoryMapping=true
15:05:00      amazon-ebs: openjdk version "11.0.15" 2022-04-19 LTS
15:05:00      amazon-ebs: OpenJDK Runtime Environment 18.9 (build 11.0.15+9-LTS)
15:05:00      amazon-ebs: OpenJDK 64-Bit Server VM 18.9 (build 11.0.15+9-LTS, mixed mode, sharing)
15:05:00      amazon-ebs: Picked up JAVA_TOOL_OPTIONS: -XX:+UnlockExperimentalVMOptions -Dsun.zip.disableMemoryMapping=true
15:05:01      amazon-ebs: javac 11.0.15
15:05:01      amazon-ebs: /usr/lib/jvm/jre

Compilation error:

18:22:19      amazon-ebs: > Task :compileJava FAILED
18:22:19      amazon-ebs:
18:22:19      amazon-ebs: FAILURE: Build failed with an exception.
18:22:19      amazon-ebs:
18:22:19      amazon-ebs: * What went wrong:
18:22:19      amazon-ebs: Execution failed for task ':compileJava'.
18:22:19      amazon-ebs: > error: invalid source release: 17
...
amazon-ebs: * Exception is:
18:22:19      amazon-ebs: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':compileJava'.
...
18:22:19      amazon-ebs: Caused by: java.lang.IllegalArgumentException: error: invalid source release: 17
...

Additional context
The packages java-17-openjdk-devel java-17-openjdk-jmods are no more available for centos 7, not even in the centos archive.
We see two solutions:
1- Revert to openjdk 11
2- Upgrade to centos 8 (but we need to evaluate if openshift 3.11 will work as expected in centos 8, because upgrading the underlying os of the host to centos 8 would be mandatory).

@victorpablosceruelo
Copy link
Contributor Author

We’ve found a solution to our problem.

AdoptOpenJDK moved to the eclipse foundation and its name is now Eclipse Temurin, by Adoptium.

https://adoptopenjdk.net/installation.html

There is a guide to install the new packages in a CentOS/RHEL/Fedora distro:

https://adoptium.net/es/installation/linux/

And the packages repository contains packages for centos 7:

https://packages.adoptium.net/ui/native/rpm/centos/7/x86_64/Packages/

So, we could install it more or less easily in our centos 7 and ubi 8 images.

We are still evaluating solutions, but I wanted to write it here so all of us know about this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

6 participants