Bug 1040085 - java.lang.UnsupportedClassVersionError: ... : Unsupported major.minor version 52.0
Summary: java.lang.UnsupportedClassVersionError: ... : Unsupported major.minor version...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: java-1.7.0-openjdk
Version: 5.11
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: rc
: ---
Assignee: jiri vanek
QA Contact: BaseOS QE - Apps
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-10 16:53 UTC by crossfire2003
Modified: 2014-02-03 16:07 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-02-03 16:07:17 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description crossfire2003 2013-12-10 16:53:48 UTC
Description of problem:

When a user tries to run Java code that was not compiled for the currently set jre version a ugly stack trace is shown:

java.lang.UnsupportedClassVersionError: ... : Unsupported major.minor version 52.0
...

Whenever something like this happens in our software, we tell our users. This is a bug, we need to fix it.

I would expect a message like: You are running the wrong Java version on this machine: 1.7, please install and set the right java version: 1.8

A normal user will first have to find out what a major.minor version is, then have to find the mapping between majaor.minor and Java version, depending on vendor, this  could even vary. This is not a good user experience.

Version-Release number of selected component (if applicable):


How reproducible:
always

Steps to Reproduce:
1. Install and set java 7: java -version should show 1.7
2. Run Java 8 compiled code against this java version


Actual results:
java.lang.UnsupportedClassVersionError: ... : Unsupported major.minor version 52.0

Expected results:
You are running the wrong Java version on this machine: 1.7, please install and set the right java version: 1.8

Additional info:

Comment 1 RHEL Program Management 2014-01-29 10:33:26 UTC
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux release.  Product Management has
requested further review of this request by Red Hat Engineering, for
potential inclusion in a Red Hat Enterprise Linux release for currently
deployed products.  This request is not yet committed for inclusion in
a release.

Comment 2 Deepak Bhole 2014-02-03 15:47:46 UTC
The message shown by Java has been standard for many years now and there could be scripts and other applications that actually try to parse this and act accordingly.

Given the ubiquity of the message, I don't think changing it is advisable.

Comment 3 RHEL Program Management 2014-02-03 16:07:17 UTC
Development Management has reviewed and declined this request.
You may appeal this decision by reopening this request.


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