Bug 1173503

Summary: java-1.8.0-openjdk is not automatically recognized as better option for alternatives than java-1.7.0-openjdk
Product: Red Hat Enterprise Linux 6 Reporter: Frantisek Reznicek <freznice>
Component: java-1.8.0-openjdkAssignee: jiri vanek <jvanek>
Status: CLOSED DUPLICATE QA Contact: BaseOS QE - Apps <qe-baseos-apps>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.6CC: ahughes, dbhole, dkochuka, esammons, jvanek, pbhoot, sbaiduzh
Target Milestone: rcKeywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1245238 (view as bug list) Environment:
Last Closed: 2015-08-10 12:44:04 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1245238    
Attachments:
Description Flags
Terminal transcript none

Description Frantisek Reznicek 2014-12-12 10:02:07 UTC
Description of problem:

java-1.8.0-openjdk is not automatically recognized as betetr option for alternatives than java-1.7.0-openjdk.

Alternatives comes with 'best' version which together with jvm/jdk alternatives priority helps to set 'best' jvm/jdk to use.

The customers may expect that jvm/jdk is always upgraded to best choice when installing higher jvm/jdk, see scenario below



Version-Release number of selected component (if applicable):
# rpm -qa | grep ^java-1
java-1.8.0-openjdk-1.8.0.25-3.b17.el6_6.x86_64
java-1.8.0-openjdk-headless-1.8.0.25-3.b17.el6_6.x86_64
java-1.8.0-openjdk-devel-1.8.0.25-3.b17.el6_6.x86_64

java-1.5.0-gcj-1.5.0.0-29.1.el6.x86_64
java-1.6.0-openjdk-1.6.0.33-1.13.5.1.el6_6.x86_64
java-1.7.0-openjdk-1.7.0.71-2.5.3.1.el6.x86_64
java-1.7.0-openjdk-devel-1.7.0.71-2.5.3.1.el6.x86_64
java-1.6.0-openjdk-devel-1.6.0.33-1.13.5.1.el6_6.x86_64


How reproducible:
100%

Steps to Reproduce:
1. yum install java-1.5.0-gcj-devel
2. alternatives --display java shows java-1.5.0-gcj link
3. yum install java-1.6.0-openjdk-devel
4. alternatives --display java shows java-1.6.0-openjdk link
5. yum install java-1.7.0-openjdk-devel
6. alternatives --display java shows java-1.7.0-openjdk link
7. yum install java-1.8.0-openjdk-devel
8. alternatives --display java should show java-1.8.0-openjdk link but shows java-1.7.0-openjdk link

Note: no manual alternatives manipulation done in the current testing scenario.


Actual results:
Installing java-1.8.0-openjdk-devel do not switch default alternatives to ava-1.8.0-openjdk*

Expected results:
Installing java-1.8.0-openjdk-devel switches default alternatives to ava-1.8.0-openjdk* (if there is no higher one)

Comment 1 Frantisek Reznicek 2014-12-12 10:05:05 UTC
Created attachment 967539 [details]
Terminal transcript

Comment 3 jiri vanek 2014-12-18 18:37:27 UTC
Sure. Priority is set to 0 for jdk8 in rhel6.

This is candidate to not a bug.

Comment 4 jiri vanek 2014-12-19 10:13:46 UTC
This is intentional behaviour. In rhel6 jdk 8 is, and probably remains, tech preview.  For rhel7, the behaviour is same right now. But may be suspect of change.

Comment 5 Piyush Bhoot 2015-07-21 12:04:18 UTC
Hi team,

JDK 8 is no more tech preview. Time to rethink this behaviour?

Best Regards,
Piyush

Comment 6 jiri vanek 2015-07-21 12:33:00 UTC
Not so sure for rhel6....

Comment 7 Deepak Bhole 2015-07-21 13:36:19 UTC
It's been there for a while, and we are soon going to make OpenJDK8 the default for IcedTea-Web everywhere, so I think it is safe to set the priority higher than 7 for the next release.

Comment 8 Deepak Bhole 2015-07-21 13:37:10 UTC
(In reply to Deepak Bhole from comment #7)
> It's been there for a while, and we are soon going to make OpenJDK8 the
> default for IcedTea-Web everywhere, so I think it is safe to set the
> priority higher than 7 for the next release.

This will only be for java provides of course, not java-devel, which will stay at java8-devel

Comment 9 jiri vanek 2015-07-21 14:27:31 UTC
to late for 6.7 but for 6.8 (and 7.2?) I will align priority to regualr openjdk one then. (https://bugzilla.redhat.com/show_bug.cgi?id=1189084)

Comment 10 Andrew John Hughes 2015-07-21 18:45:21 UTC
I'd say any move to make OpenJDK 8 the default JVM should depend on OpenJDK 8 having ECC support:

https://bugzilla.redhat.com/show_bug.cgi?id=1208307

OpenJDK 7 has this as of 6.7 so I don't think we should start preferring OpenJDK 8 over that unless it can provide the same functionality.

Generally, we should also ensure that bug fixes don't regress from 7 to 8.

Comment 11 Deepak Bhole 2015-07-22 15:31:34 UTC
(In reply to Andrew John Hughes from comment #10)
> I'd say any move to make OpenJDK 8 the default JVM should depend on OpenJDK
> 8 having ECC support:
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=1208307
> 
> OpenJDK 7 has this as of 6.7 so I don't think we should start preferring
> OpenJDK 8 over that unless it can provide the same functionality.
> 
> Generally, we should also ensure that bug fixes don't regress from 7 to 8.

The higher priority only comes into play if alternative link is set to auto mode. Almost all production systems would be expected to set the link manually. Manual links will not be changed if a higher priority JDK is installed.

Comment 12 Deepu K S 2015-07-24 12:20:46 UTC
Hello Jiri,

As a workaround, can we manually edit the '/var/lib/alternatives/java' file and increase the priority for java-1.8.0-openjdk.

Like adding the value as, 
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.51-0.b16.el6_6.x86_64/jre/bin/java
180051


# alternatives --config java

There are 11 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
   1           /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
   2           /usr/lib/jvm/jre-1.5.0-gcj/bin/java
   3           /usr/lib/jvm/jre-1.7.0-oracle.x86_64/bin/java
   4           /usr/java/jre1.7.0_67/bin/java
   5           /usr/lib/jvm/jre-1.8.0-oracle.x86_64/bin/java
   6           /usr/lib/jvm/jre-1.6.0-sun.x86_64/bin/java
   7           /usr/lib/jvm/jre-1.6.0-sun/bin/java
   8           /usr/java/jre1.8.0_20/bin/java
   9           /usr/java/jre1.7.0_79/bin/java
*+ 10          /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.51-0.b16.el6_6.x86_64/jre/bin/java
   11          /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java

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

Thanks.

Comment 13 jiri vanek 2015-08-10 12:44:04 UTC

*** This bug has been marked as a duplicate of bug 1251560 ***