Bug 1302448 - java-1.8.0-openjdk has a higher alternatives priority than java-1.8.0-oracle
Summary: java-1.8.0-openjdk has a higher alternatives priority than java-1.8.0-oracle
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: java-1.8.0-openjdk
Version: 7.2
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: rc
: ---
Assignee: jiri vanek
QA Contact: BaseOS QE - Apps
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-01-27 22:54 UTC by Brandon Ingalls
Modified: 2019-10-10 11:01 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-01-29 08:44:56 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Brandon Ingalls 2016-01-27 22:54:50 UTC
Description of problem:
java-1.8.0-openjdk has a higher alternatives priority than java-1.8.0-oracle, this has caused issues with some of our java apps in-house.

In the java-1.8.0-openjdk-headless-1.8.0.65-2.b17.el7_1 package the priority was set to `0000065`
```
$ rpm -qi java-1.8.0-openjdk-headless --scripts
...
alternatives \
  --install /usr/bin/java java /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.65-2.b17.el7_1.x86_64/jre/bin/java 0000065 \
...

```

In `java-1.8.0-openjdk-headless-1.8.0.71-2.b15.el7_2.x86_64` the priority has been set to `1800071`.
```
PRIORITY=1800071
if [ "" == "-debug" ]; then
  let PRIORITY=PRIORITY-1
fi

ext=.gz
alternatives \
  --install /usr/bin/java java /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.71-2.b15.el7_2.x86_64/jre/bin/java $PRIORITY  \
...
```

The `java-1.8.0-oracle-1.8.0.71-1jpp.1.el7.x86_64` package sets its priority to `180071`.

Is there any reason OpenJDK should be replacing Oracle's Java?

Version-Release number of selected component (if applicable):


How reproducible:
Install java-1.8.0-oracle-1.8.0.71-1jpp.1.el7.x86_64 and java-1.8.0-openjdk-headless-1.8.0.71-2.b15.el7_2.x86_64, then check alternatives to see which is being used.

Actual results:
```
[root@rhel7-dev-vm2 ~]# alternatives --config java

There are 2 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
   1           /usr/lib/jvm/java-1.8.0-oracle-1.8.0.71-1jpp.1.el7.x86_64/jre/bin/java
*+ 2           /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.71-2.b15.el7_2.x86_64/jre/bin/java

Enter to keep the current selection[+], or type selection number:
```

Expected results:
```
[root@rhel7-dev-vm2 ~]# alternatives --config java

There are 2 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
*+ 1           /usr/lib/jvm/java-1.8.0-oracle-1.8.0.71-1jpp.1.el7.x86_64/jre/bin/java
   2           /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.71-2.b15.el7_2.x86_64/jre/bin/java

Enter to keep the current selection[+], or type selection number:
```

Additional info:

Comment 2 jiri vanek 2016-01-29 08:44:56 UTC
Hello. This is intended behavior. Little bit more can be read at: https://bugzilla.redhat.com/show_bug.cgi?id=1189084

The reason for ibm and oracle being lowered to openjdk is fact, that they are only supplementary, third party products. So we can not quickly enough react on bug in code. On opoiste in openjdk we can. Thats why it is prioritized.

Comment 3 Brandon Ingalls 2016-01-29 18:37:06 UTC
(In reply to jiri vanek from comment #2)
> Hello. This is intended behavior. Little bit more can be read at:
> https://bugzilla.redhat.com/show_bug.cgi?id=1189084
> 
> The reason for ibm and oracle being lowered to openjdk is fact, that they
> are only supplementary, third party products. So we can not quickly enough
> react on bug in code. On opoiste in openjdk we can. Thats why it is
> prioritized.

If I install the Oracle package for java it is because I need it for an application to work, the only reason openjdk ever gets installed is because it gets pulled in from other dependencies.

I feel that the package that someone has to go out of their way to install should have priority over openjdk.

All the same I have corrected the issue on our systems with Puppet, it is a bit of a bummer that we now have to manage alternatives for java, where everything worked in the past, this update made many of our enterprise applications unusable.


Note You need to log in before you can comment on or make changes to this bug.