sous-chefs / java

Development repository for the java cookbook
https://supermarket.chef.io/cookbooks/java
Apache License 2.0
386 stars 637 forks source link

Java dependencies accidentally undesired openjdk #519

Closed nkadel closed 4 years ago

nkadel commented 5 years ago

Cookbook version

java

Chef-client version

All

Platform Details

RHEL 7

Scenario:

Install only Oracle JDK via RPM or tarball, especially via RPM.

Steps to Reproduce:

1) Install RPM based jdk on RHEL with java cookbook. 2) Yum install any RPM that has a requirement on the "jre-headless" metapackage or the "java-devel" packages such as ant.

Expected Result:

Install expected RPM only. Do not install unrequested JDK.

Actual Result:

RPM dependency is resolved by installing openjdk. Installing openjdk from scratch resets /usr/bin/java to a symlink via /etc/alternatives to the openjdk version of Java. The result is mollified by the Chef cookbook creation of /etc/profile.d/jdk.sh, but it's stilling an undesired and unnecessary Java.

The workaround is to either install the designated packages and dependencies while blocking the openjdk or similar packages in /etc/yum.repo, not in /etc/yum.repos.d/ or in RedHat Satellite channels, but to actually install a compatibility plugin RPM that fills the gap. I publish some, at https://github.com/nkadel/jdk1.8.0-compat-x-srpm, but they'd need some support to pull into Chef.

damacus commented 4 years ago

Closing due to inactivity.

If this is still an issue please reopen or open another issue. Alternatively drop by the #sous-chefs channel on the Chef Community Slack and we'll be happy to help!

Thanks, Sous-Chefs