I tried to play minecraft 1.8.2 this evening, only to have it crash on every startup with :

Time: 19/02/15 18:58
Description: Initializing game
java.lang.ExceptionInInitializerError
at avf.ar(SourceFile:560)
at avf.am(SourceFile:361)
at avf.a(SourceFile:310)
at net.minecraft.client.main.Main.main(SourceFile:124)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
at org.lwjgl.opengl.LinuxDisplay.getAvailableDisplayModes(LinuxDisplay.java:951)
at org.lwjgl.opengl.LinuxDisplay.init(LinuxDisplay.java:738)
at org.lwjgl.opengl.Display.(Display.java:138)
... 4 more

The cause seems to be the move from lwjgl 2.9.1 to 2.9.4 with Minecraft 1.8.2.

After a lot of debugging and swearing from me, Steve found out that it was an issue with my dual monitors. Installing xrandr fixes lwjgl and then allows minecraft to start.

The issue comes from this line in the XRandR class which doesnt throw any exception when the command isnt available. Parsing command line output from a child process in Java is really a bad idea.

Warning

This entry was posted
on Thursday, February 19th, 2015 at 7:07 pm and is filed under Linux.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.

Thank you so much for this! Minecraft was working fine on our home Linux machines until a few days ago. My son tried to launch Minecraft today and it kept crashing with the same Java trace you show in this blog post. Installing the xorg-xrandr package (the machine where this was happening runs ArchLinux) fixed the problem. This is a laptop and I have no extra monitors, though.

The Java crash trace and the error messages are pretty obscure, in my opinion, so I think I got lucky that I found your blog post and the hint to install xrandr.

Basically, my xrandr was showing two “connected” displays (my VGA port shows up, even when there isn’t anything physically connected to it) and that must have been giving lwjgl trouble. I wrote a script named ‘xrandr’ to filter (so to speak) the output of the real xrandr command, then modified my Minecraft launch script to juggle the path so the Minecraft JVM picks up the filtered command instead of the real one.