Bug 1364518 - libguestfs-java: mismatch class version vs java dependency
Summary: libguestfs-java: mismatch class version vs java dependency
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libguestfs
Version: 7.3
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: rc
: ---
Assignee: Richard W.M. Jones
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-05 14:51 UTC by Pino Toscano
Modified: 2017-08-01 22:08 UTC (History)
6 users (show)

Fixed In Version: libguestfs-1.36.1-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1319086
Environment:
Last Closed: 2017-08-01 22:08:55 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:2023 normal SHIPPED_LIVE libguestfs bug fix and enhancement update 2017-08-01 19:32:01 UTC

Description Pino Toscano 2016-08-05 14:51:46 UTC
+++ This bug was initially created as a clone of Bug #1319086 +++

Description of problem:

Jar archive /usr/share/java/libguestfs-1.20.11.jar contains classes, which are version '51' (java 7). 
However package has set runtime requires as 'java >= 1.5.0'
If for whatever reason java 1.6.0 or less was installed, no class from the jar could be run because it is not compatible.

Version-Release number of selected component (if applicable):
libguestfs-java-1.20.11-14.el6

How reproducible:
always

Steps to Reproduce:
1. jar xf /usr/share/java/libguestfs-1.20.11.jar
2. find . -name '*class' -exec file {} \;
3. rpm -qR libguestfs-java

Actual results:
compiled Java class data, version 51.0 (Java 1.7)
java >= 1.5.0

Expected results:
java requirement always satisfies compiled java class version


Additional info:
BuildRequires list java-1.7.0-openjdk-devel, so it seems that only requires are too old.

========================================

The same issue applies for RHEL 7 -- albeit with different versions of libguestfs, of course.

Comment 1 Richard W.M. Jones 2017-02-16 13:59:22 UTC
Pino is this fixed by c39d5e89c3b3884309cfaea16721b9ec25c98868?

Comment 2 Pino Toscano 2017-02-16 14:41:46 UTC
(In reply to Richard W.M. Jones from comment #1)
> Pino is this fixed by c39d5e89c3b3884309cfaea16721b9ec25c98868?

Don't think so, as the code removed did not do much.  Indeed, the bytecode version was already for java 7.

Comment 4 Richard W.M. Jones 2017-02-16 15:00:29 UTC
OK, got it, the fix is:

 %package java
 Summary:       Java bindings for %{name}
 Requires:      %{name} = %{epoch}:%{version}-%{release}
-Requires:      java-headless >= 1.5.0
+Requires:      java-headless >= 1.7.0
 Requires:      jpackage-utils

This was already done in the RHEL 6 branch.

Comment 6 YongkuiGuo 2017-03-28 09:41:15 UTC
Verified with package:
libguestfs-1.36.3-1.el7.x86_64
libguestfs-java-1.36.3-1.el7.x86_64


Steps:
1. jar xf /usr/share/java/libguestfs.jar
2. find . -name '*class' -exec file {} \;
./com/redhat/et/libguestfs/Application.class: compiled Java class data, version 51.0 (Java 1.7)
./com/redhat/et/libguestfs/Application2.class: compiled Java class data, version 51.0 (Java 1.7)
...

3. rpm -qR libguestfs-java
/sbin/ldconfig
/sbin/ldconfig
java-headless >= 1.7.0
...

Actual results:
compiled Java class data, version 51.0 (Java 1.7)
java-headless >= 1.7.0

Java requirement can be able to satisfy compiled java class version.
So verified.

Comment 7 errata-xmlrpc 2017-08-01 22:08:55 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:2023


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