Fixing Minecraft on Ubuntu with OpenJDK

Minecraft! On Ubuntu! It actually runs great, once you actually get it to run, but there were two little things mere mortals can’t be reasonably expected to debug.

Can’t connect to minecraft.net

My Internet connection worked, minecraft.net was up, friends were able to connect just fine, but I couldn’t. Running it from the terminal via java -jar minecraft.jar showed the error message java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty.

Basically, Minecraft uses SSL to protect your login, but Java didn’t have the certificates needed to verify. The Minecraft launcher really should give a better error message, but this was really Ubuntu’s fault. You need the ca-certificates-java package installed, but on my Ubuntu install, it was broken. Try doing ls /etc/ssl/certs/java/cacerts. If it comes up missing, then you need copy it from a friend or a different Unix machine. You don’t want to copy security files from strangers…

Black screen

Looking in the terminal showed the error java.lang.UnsatisfiedLinkError: ...: libjawt.so: cannot open shared object file: No such file or directory. There’s no good reason why an OpenJDK install can’t find its own damn libraries, but you can manually set your LD_LIBRARY_PATH variable to contain it.

Try doing locate libjawt.so. You’ll want to set your LD_LIBRARY_PATH to include one of the directories it gives you (just the directory, not included the file). Depending on whether you have OpenJDK 6 or 7, you’ll do something like:

LD_LIBRARY_PATH=/usr/lib/jvm/java-7-openjdk-i386/jre/lib/i386/ java -jar minecraft.jar

Again, check the results of locate versus your OpenJDK version (if you’re not sure, run java -version).

3 Responses to “Fixing Minecraft on Ubuntu with OpenJDK”

  1. SF_Chipan writes:

    Hi, Eric Jiang. I have a problem with my minecraft in ubuntu 12.10 and I hope you can help me.

    When I run the command”java -Xmx1024M -Xms512M -cp minecraft.jar net.minecraft.LauncherFrame”,the game window appeared, but it always black screen.

    and the error prompt is:
    Exception in thread “Thread-4” java.lang.UnsatisfiedLinkError: /home/sfchipan/.minecraft/bin/natives/liblwjgl.so: /home/sfchipan/.minecraft/bin/natives/liblwjgl.so: ?? ELF ?: ELFCLASS32 (Possible cause: architecture word width mismatch)
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary1(Unknown Source)
    at java.lang.ClassLoader.loadLibrary0(Unknown Source)
    at java.lang.ClassLoader.loadLibrary(Unknown Source)
    at java.lang.Runtime.load0(Unknown Source)
    at java.lang.System.load(Unknown Source)
    at org.lwjgl.Sys$1.run(Sys.java:69)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.lwjgl.Sys.doLoadLibrary(Sys.java:65)
    at org.lwjgl.Sys.loadLibrary(Sys.java:81)
    at org.lwjgl.Sys.(Sys.java:98)
    at net.minecraft.client.Minecraft.F(SourceFile:1976)
    at asz.(SourceFile:20)
    at net.minecraft.client.Minecraft.(SourceFile:75)
    at asq.(SourceFile:38)
    at net.minecraft.client.MinecraftApplet.init(SourceFile:38)
    at net.minecraft.Launcher.replace(Launcher.java:136)
    at net.minecraft.Launcher$1.run(Launcher.java:79)

    By the way, myy java’s version is 1.7.0_11 and vedio card is ATI Madison [Radeon HD 5000M Series].

    Thanks for your help!

  2. Jeff Rasmussen writes:

    ELFCLASS32 usually means that you are incorrectly using a 32-bit application on a 64-bit system. The fix is usually creating a symbolic link from the 32-bit library to the 64-bit side or pointing directly to the correct library file as explained above for libjawt.so.

  3. Jeff Rasmussen writes:

    Try running “sudo apt-get install ia32-libs” to allow for 32-bit compatibility on 64 bit systems

Leave a Reply