JDK-8016644 : Improve UnsupportedClassVersionError message
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2013-03-20
  • Updated: 2016-08-10
  • Resolved: 2014-02-10
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u20Fixed 9 b04Fixed
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Description
A DESCRIPTION OF THE REQUEST :
I tried to run a jar file and got this crash message: Exception in thread  " main "  java.lang.UnsupportedClassVersionError: com/ka/excelcmp/ExcelCompare : Unsupported major.minor version 51.0.

  To an ordinary user, such a crash would directly lead to giving up.

Instead, the message should communicate the fact that I tried to run a program that required a version of Java that was incompatible because it was at least one major revision later than the version that is installed.

JUSTIFICATION :
This is an exception that is seen by end users and therefore it should tell them what they need to know, either in English or with a URL to a web page that explains the problem.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Best would be for every exception message to include a URL to a page that first explains what it might mean to an end user, and then farther down the page explains what it might mean to a programmer, including a link to the exception in the API documentation.
ACTUAL -
 " Unsupported major.minor version 51.0 " , which is incomprehensible to an end user
Comments
We are not going to add URLs to exception messages but this message could give more information. Eg: java.lang.UnsupportedClassVersionError:com/foo/Bar Unsupported class file version 51.0. This VM only recognizes versions up to 49.0 or java.lang.UnsupportedClassVersionError:: com/foo/Bar has been compiled by a more recent Java version (class file version 51.0) that is not supported by this VM
17-06-2013