Bug 1302448 - java-1.8.0-openjdk has a higher alternatives priority than java-1.8.0-oracle
java-1.8.0-openjdk has a higher alternatives priority than java-1.8.0-oracle
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: java-1.8.0-openjdk (Show other bugs)
7.2
x86_64 Linux
unspecified Severity low
: rc
: ---
Assigned To: jiri vanek
BaseOS QE - Apps
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-01-27 17:54 EST by Brandon Ingalls
Modified: 2016-03-04 01:37 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-01-29 03:44:56 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Brandon Ingalls 2016-01-27 17:54:50 EST
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 03:44:56 EST
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 13:37:06 EST
(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.