StokeBloke.com

Archive for February, 2015

Minecraft 1.8.2 – ArrayIndexOutOfBoundsException at LinuxDisplay.getAvailableDisplayModes()

Thursday, February 19th, 2015

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

/**
* Utility for working with the xrandr commmand-line utility. Assumes
* xrandr v1.2 or higher.
*/

Disable ipv6 on mint/ubuntu

Thursday, February 5th, 2015

How to disable ipv6 on ubunut distros

Edit the sysctl.conf file

sudo emacs /etc/sysctl.conf

append the following to the end of the file

# IPv6 disabled
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

Reload sysctl config

sudo sysctl -p

Now checks its gone by running ipconfig

eth0   Link encap:Ethernet HWaddr e0:db:55:bc:1e:bb 
       inet addr:192.168.0.133 Bcast:192.168.0.255 Mask:255.255.255.0
       UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
       RX packets:429875 errors:0 dropped:0 overruns:0 frame:0
       TX packets:154053 errors:0 dropped:0 overruns:0 carrier:0
       collisions:0 txqueuelen:1000 
       RX bytes:300878637 (300.8 MB) TX bytes:17446275 (17.4 MB)