Waterfall icon indicating copy to clipboard operation
Waterfall copied to clipboard

Include Recommended-Version in the jar manifest

Open TrixterTheTux opened this issue 4 years ago • 0 comments

Is your feature request related to a problem?

With the newest minecraft versions moving towards more newer java versions, it is rather hard to allow users to switch between multiple different jars without impacting user experience due to possibly running the wrong java version. This issue aims to solve this problem (in the future releases) by allowing indicating the recommended version for automated tools (e.g. game panels automatically choosing the wanted version) to avoid having to run the minimum version of java.

Describe the solution you'd like.

The jar's manifest file (meta-inf/manifest.mf) could include the field Recommended-Version which would contain the major version number of the recommended java version for the jar. This allows any automated tool to check if it's present and automatically choose the recommended java version over having to rely on either the user choosing the correct version or using the minimum required version included in the java classes bytecode (leading to possible warning messages in console).

Describe alternatives you've considered.

You can parse the target java version from the java classes bytecode (https://en.wikipedia.org/wiki/Java_class_file#General_layout), but this only provides the minimum required version. Alternatively, you'd need to manually maintain a list of which minecraft versions should use which java version.

TrixterTheTux avatar May 13 '21 21:05 TrixterTheTux