mojira.dev
MC-197271

Minecraft server/client does not load on OpenJ9

When attempting to run the Minecraft server jar with a Java executable compiled with the OpenJ9 VM, it fails to load and instead prints a stack trace:

 

Exception in thread "main" java.lang.BootstrapMethodError: java.lang.ExceptionInInitializerError
{{ at hk.<clinit>(SourceFile:50)}}
{{ at gm.<clinit>(SourceFile:237)}}
{{ at vm.a(SourceFile:42)}}
{{ at net.minecraft.server.Main.main(SourceFile:88)}}
Caused by: java.lang.ExceptionInInitializerError
{{ at java.lang.J9VMInternals.ensureError(J9VMInternals.java:148)}}
{{ at java.lang.J9VMInternals.recordInitializationFailure(J9VMInternals.java:137)}}
{{ at java.lang.invoke.MethodHandle.getCPMethodHandleAt(Native Method)}}
{{ at java.lang.invoke.MethodHandle.getAdditionalBsmArg(MethodHandle.java:869)}}
{{ at java.lang.invoke.MethodHandle.resolveInvokeDynamic(MethodHandle.java:948)}}
{{ ... 4 more}}
Caused by: java.lang.NullPointerException
{{ at hk.a(SourceFile:88)}}
{{ at kk.a(SourceFile:20)}}
{{ at kk.<clinit>(SourceFile:13)}}
{{ ... 7 more}}

 

Steps to replicate:

1: Download an OpenJ9 build from https://adoptopenjdk.net

2: Run the server jar in the command line with any arguments

 

Expected behavior:

The Minecraft server properly loads.

 

This occurred on 1.16.2 Pre-release 2 as well, and did not seem to occur on pre-release 1. I am able to replicate this on both Windows and Linux operating systems.

Linked issues

Comments 16

Another moderator's comment on MC-148371:

At no point have the developers indicated the game is expected to run on 3rd party JVMs. Considering OpenJ9 is expected to be fully compatible with java 8, which is used for the game's development, it's probable the issue resides within the JVM itself, rather than the code written for the game.

Please explain how this is a bug with Minecraft and not with OpenJ9.

Well, it worked perfectly in 1.15.2, 1.16, 1.16.1 and 1.16.2 pre-release 1. Every version after that stopped working (pr 2, 3 and rc1)

If it worked and now it doesn't without upgrading Java, only changing the Minecraft version, I'm gonna say is Minecraft problem.

Please also report this to OpenJ9's github page as a potential bug on their end, as everything works just fine with the JVM that comes with the game and is still likely an issue on OpenJ9's end.

I think is already reported, but in my opinion Mojang could check what happened in 1.16.2 pr2, because something has changed in that version.

6 more comments

This issue also affects the proprietary IBM J9 virtual machine (version 8) and is present for both the client and the dedicated server software on the released 1.16.2 version.

A fix has been made to Paper: https://github.com/PaperMC/Paper/pull/4179

Made in spigot mappings

The openj9-0.23.0-m2 release should fix this.

DoctorMad

(Unassigned)

Community Consensus

Important

Crash, Dedicated Server

1.16.2 Pre-release 3, 1.16.2 Release Candidate 1, 1.16.2 Release Candidate 2, 1.16.2

Retrieved