8016644: Improve UnsupportedClassVersionError message

Improved the UnsupportedClassVersionError message to hopefully be more user friendly

Reviewed-by: coleenp, dholmes, twisti
This commit is contained in:
Christian Tornqvist 2014-02-10 17:49:17 +01:00
parent 7a48daef16
commit dd25d6fed0
3 changed files with 91 additions and 5 deletions

View file

@ -3746,18 +3746,24 @@ instanceKlassHandle ClassFileParser::parseClassFile(Symbol* name,
Exceptions::fthrow(
THREAD_AND_LOCATION,
vmSymbols::java_lang_UnsupportedClassVersionError(),
"Unsupported major.minor version %u.%u",
"Unsupported class file version %u.%u, "
"this version of the Java Runtime only recognizes class file versions up to %u.%u",
major_version,
minor_version);
minor_version,
JAVA_MAX_SUPPORTED_VERSION,
JAVA_MAX_SUPPORTED_MINOR_VERSION);
} else {
ResourceMark rm(THREAD);
Exceptions::fthrow(
THREAD_AND_LOCATION,
vmSymbols::java_lang_UnsupportedClassVersionError(),
"%s : Unsupported major.minor version %u.%u",
"%s has been compiled by a more recent version of the Java Runtime (class file version %u.%u), "
"this version of the Java Runtime only recognizes class file versions up to %u.%u",
name->as_C_string(),
major_version,
minor_version);
minor_version,
JAVA_MAX_SUPPORTED_VERSION,
JAVA_MAX_SUPPORTED_MINOR_VERSION);
}
return nullHandle;
}