Minecraft on ubuntu

From finninday
Jump to navigation Jump to search

Background

The best reference I've found so far is this: http://www.minecraftforum.net/topic/1412606-minecraft-and-ubuntu-the-guide-v10/ But I've tried the steps it proposes and still get a black screen after login.

Starting point is

  • the latest minecraft jar downloaded from here:

https://minecraft.net/download

  • Oracle java7 (I think this is preferred for minecraft)
rday@muno:~/.minecraft/bin$ java -version
java version "1.7.0_09"
Java(TM) SE Runtime Environment (build 1.7.0_09-b05)
Java HotSpot(TM) Server VM (build 23.5-b02, mixed mode)
  • Ubuntu 12.10 quantal

Problem

When I try to launch the game, I get a black screen and this stack trace:

rday@muno:~/.minecraft/bin$ java -jar minecraft.jar 
Exception in thread "main" java.lang.NoClassDefFoundError: org/lwjgl/LWJGLException
	at java.lang.Class.getDeclaredMethods0(Native Method)
	at java.lang.Class.privateGetDeclaredMethods(Class.java:2442)
	at java.lang.Class.getMethod0(Class.java:2685)
	at java.lang.Class.getMethod(Class.java:1620)
	at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:492)
	at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:484)
Caused by: java.lang.ClassNotFoundException: org.lwjgl.LWJGLException
	at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
	... 6 more

The class referenced in the error is present in ~/.minecraft/bin/lwjgl.jar

rday@muno:~/.minecraft/bin$ jar tvf lwjgl.jar | grep Exception
   792 Thu Apr 15 22:20:30 PDT 2010 org/lwjgl/LWJGLException.class


I see this same exception no matter which version of java I use. I've tried it with:

  • Oracle java 6 (1.6.0_37)
  • Oracle java 7 (1.7.0_09)
  • openjdk 6 (1.6.0_24)
  • openjdk 7 (1.7.0_09)

I tried installing liblwjgl-java, but I still get the same failure.

apt-get install liblwjgl-java

Solution

Here is a fix for the problem: http://www.minecraftwiki.net/wiki/Tutorials/Update_LWJGL

I tried downloading the latest lwjgl and copying the jars and native libraries into the .minecraft/bin directory, but still got the same error. So then I tried the refresh procedure below, but without removing the .minecraft directory and it worked.


Refresh procedure

After I fiddle around with things, I use these steps to get back to a known baseline.

  • rm -rf ~/.minecraft
  • java -jar ~/Downloads/minecraft.jar

This reinstalls everything in the .minecraft directory, but then fails with this error:

rday@muno:~/Downloads$ java -jar minecraft.jar 
asdf
java.io.FileNotFoundException: /home/rday/.minecraft/lastlogin (No such file or directory)
	at java.io.FileInputStream.open(Native Method)
	at java.io.FileInputStream.<init>(FileInputStream.java:138)
	at net.minecraft.LoginForm.readUsername(LoginForm.java:110)
	at net.minecraft.LoginForm.<init>(LoginForm.java:55)
	at net.minecraft.LauncherFrame.<init>(LauncherFrame.java:23)
	at net.minecraft.LauncherFrame.main(LauncherFrame.java:167)
	at net.minecraft.MinecraftLauncher.main(MinecraftLauncher.java:13)
Exception in thread "Thread-3" java.lang.UnsatisfiedLinkError: /home/rday/.minecraft/bin/natives/liblwjgl.so: libjawt.so: cannot open shared object file: No such file or directory
	at java.lang.ClassLoader$NativeLibrary.load(Native Method)
	at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1939)
	at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1864)
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1825)
	at java.lang.Runtime.load0(Runtime.java:792)
	at java.lang.System.load(System.java:1059)
	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.<clinit>(Sys.java:98)
	at net.minecraft.client.Minecraft.F(SourceFile:1975)
	at asr.<init>(SourceFile:20)
	at net.minecraft.client.Minecraft.<init>(SourceFile:75)
	at asi.<init>(SourceFile:36)
	at net.minecraft.client.MinecraftApplet.init(SourceFile:36)
	at net.minecraft.Launcher.replace(Launcher.java:136)
	at net.minecraft.Launcher$1.run(Launcher.java:79)