RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2162040 - UnsupportedClassVersionError for jna.jar in el9 with Java 8 (it's compiled with compatibility 9, not 1.6)
Summary: UnsupportedClassVersionError for jna.jar in el9 with Java 8 (it's compiled wi...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: jna
Version: 9.1
Hardware: x86_64
OS: Linux
unspecified
urgent
Target Milestone: rc
: ---
Assignee: Zuzana Miklankova
QA Contact: Jakub Heger
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-01-18 16:29 UTC by alan.dennis
Modified: 2023-05-09 09:22 UTC (History)
5 users (show)

Fixed In Version: jna-5.6.0-8.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-05-09 07:52:58 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-145886 0 None None None 2023-01-20 10:19:20 UTC
Red Hat Issue Tracker RHELPLAN-145887 0 None None None 2023-01-20 10:19:21 UTC
Red Hat Product Errata RHBA-2023:2394 0 None None None 2023-05-09 07:52:59 UTC

Description alan.dennis 2023-01-18 16:29:11 UTC
Description of problem:

Our Java 8 application (not yet ported to Java 11) uses jna.

Installed it from jna rpm. Get this...

java.lang.UnsupportedClassVersionError: com/sun/jna/Library has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0

... i.e. jna in the rpm is only compatible with Java 9, not java 8.

java-1.8.0-openjdk is (apparently) still supported in el9, so the jna rpm should contain a jar with Java 8 compatibility. It doesn't.


Version-Release number of selected component (if applicable):
Name         : jna
Version      : 5.6.0
Release      : 6.el9
Architecture : x86_64
Size         : 279 k
Source       : jna-5.6.0-6.el9.src.rpm
Repository   : rhel-9-for-x86_64-appstream-rpms

How reproducible:
Always

Steps to Reproduce:
1. install jna rpm on RHEL9
2. install java-1.8.0-openjdk (etc)
3. run Java application using jna in java-1.8.0

Actual results:
java.lang.UnsupportedClassVersionError: com/sun/jna/Library has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0

Expected results:
Application runs normally, without error

Additional info:
I got jna-5.6.0-6.el9.src.rpm and rebuilt it, sure enough it goes...

-dynamic-properties:
...
     [echo] Java version 11.0.18, compatibility: 9, ant: 11
     [echo] JNA version 5.6.0, native 6.1.0, android 5060099
     [echo] OpenJDK 64-Bit Server VM (Red Hat, Inc., 11.0.18+10-LTS)

build.xml includes this...
  <condition property="compatibility" value="1.6" else="9">
    <matches pattern="^1\.\d+$" string="${ant.java.version}"/>
  </condition>

Java 11 should be able to produce 1.6 compatible Jars, yea?

So that regex is wrong, for Java version 11.0.18 it should be selecting 1.6, not 9, so that it builds a jar that's still compatible with the (still supported) Java 8.

Comment 1 Zuzana Miklankova 2023-01-23 14:34:55 UTC
Hello and thank you for creating the bug.

Mikolaj Izdebski created a PR[1] that should fix this.


[1] https://gitlab.com/redhat/centos-stream/rpms/jna/-/merge_requests/5/

Comment 5 Zuzana Miklankova 2023-01-30 10:34:23 UTC
One more PR was needed: https://gitlab.com/redhat/centos-stream/rpms/jna/-/merge_requests/6

Comment 12 errata-xmlrpc 2023-05-09 07:52:58 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 (jna bug fix and enhancement update), 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-2023:2394


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