Bug 1020005

Summary: s-s-j doesn't detect java-1.7.0-openjdk
Product: [Fedora] Fedora Reporter: Lukáš Zachar <lzachar>
Component: system-switch-javaAssignee: jiri vanek <jvanek>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 19CC: dbhole, omajid, pviktori
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: system-switch-java-1.1.5-8.fc19 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-02-22 18:18:58 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:
Attachments:
Description Flags
work with newer-style java-XYZ/jre as well as older jre-XYZ style alternatives none

Description Lukáš Zachar 2013-10-16 18:48:10 UTC
Description of problem:

I have installed java-1.7.0-openjdk-1.7.0.60-2.4.2.7.fc19.x86_64 but s-s-j says that:

No supported Java packages were found.
A supported Java package is one that installs a file of the form:   
/usr/lib/jvm/jre-$version-$vendor/bin/java

Version-Release number of selected component (if applicable):
java-1.7.0-openjdk-1.7.0.60-2.4.2.7.fc19.x86_64
system-switch-java-1.1.5-6.fc19.noarch

How reproducible:
always

Steps to Reproduce:
1. install java-1.7.0-openjdk
2. run system-switch-java
3.

Actual results:
An error as in the description

Expected results:
Shows installed openjdk

Additional info:

Comment 1 Omair Majid 2013-10-17 21:48:31 UTC
If you install java-1.5.0-gcj-devel too, the error is different:

$ system-switch-java

Traceback (most recent call last):
  File "/usr/sbin/system-switch-java", line 89, in <module>
    main()
  File "/usr/sbin/system-switch-java", line 50, in main
    java_identifiers, best_identifier = get_java_identifiers()
  File "/usr/share/system-switch-java/switch_java_functions.py", line 132, in get_java_identifiers
    best_identifier = java_identifiers[best]
IndexError: list index out of range

I looked into system-switch-java's source and system-switch-java is hardcoding all paths (it assumes the jre is at /usr/lib/jvm/java-${VERSION}-${VENDOR}) 

We recently changed all these paths :(

Comment 2 Omair Majid 2013-10-17 22:04:19 UTC
(In reply to Omair Majid from comment #1)
> (it assumes the jre is at /usr/lib/jvm/java-${VERSION}-${VENDOR}) 

I meant /usr/lib/jvm/jre ...

Comment 3 Omair Majid 2014-02-04 16:56:34 UTC
*** Bug 990925 has been marked as a duplicate of this bug. ***

Comment 4 Omair Majid 2014-02-08 00:34:47 UTC
Created attachment 860782 [details]
work with newer-style java-XYZ/jre as well as older jre-XYZ style alternatives

Comment 5 jiri vanek 2014-02-10 13:55:40 UTC
Are you planing to push fedora?

Comment 6 Omair Majid 2014-02-10 14:25:16 UTC
(In reply to jiri vanek from comment #5)
> Are you planing to push fedora?

Yeah, but only tested it on Fedora 20 so far.

Comment 7 Fedora Update System 2014-02-10 17:56:50 UTC
system-switch-java-1.1.5-8.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/system-switch-java-1.1.5-8.fc19

Comment 8 Fedora Update System 2014-02-11 22:57:35 UTC
Package system-switch-java-1.1.5-8.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing system-switch-java-1.1.5-8.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-2242/system-switch-java-1.1.5-8.fc19
then log in and leave karma (feedback).

Comment 9 Fedora Update System 2014-02-22 18:18:58 UTC
system-switch-java-1.1.5-8.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.