JDK-8163549 : Unsupported major.minor version error message should be enhanced
  • Type: Enhancement
  • Component: core-svc
  • Sub-Component: tools
  • Affected Version: 8,9
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • OS: linux
  • CPU: x86_64
  • Submitted: 2016-08-09
  • Updated: 2016-08-10
  • Resolved: 2016-08-10
Related Reports
Relates :  
Description
A DESCRIPTION OF THE REQUEST :
The message "Unsupported major.minor version 52.0" in unnecessarily cryptic. This message should show both the version of the running JRE and the version of the class file in 'human readable' terms. For example:

Class version 1.8 is not supported by JRE 1.7.

JUSTIFICATION :
We support junior Java programmers. About once a week, we get a question related to this error message.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Class version 1.8 is not supported by JRE 1.7.
ACTUAL -
Unsupported major.minor version 52.0


Comments
Enhancement proposal to have more meaningful error message then just showing "Unsupported major.minor version 52.0" We have very fixed major version for major jre releases like Java SE 8 = 52, Java SE 7 = 51, Java SE 6.0 = 50, Java SE 5.0 = 49, JDK 1.4 = 48, JDK 1.3 = 47, JDK 1.2 = 46, JDK 1.1 = 45 Instead of just showing "Unsupported major.minor version XX.x" it will be more meaningful to show "You are class file has been compiled using jreXX that is higher version and your trying to run on jreYY which is lower version, make sure you use either jreXX or jreYY for compiling and executing your class files"
10-08-2016

Unsupported major.minor version 52.0 comes when you are trying to run a class compiled using Java 1.8 compiler into a lower JRE version e.g. JRE 1.7 or JRE 1.6
10-08-2016

The message was improved in 8016644, it's now: "Unsupported class file version %u.%u, this version of the Java Runtime only recognizes class file versions up to %u.%u" The major/minor versions of the class file is not guaranteed to increase with major/minor releases of Java and we also don't know the names of future Java releases. Closing as WNF.
10-08-2016