Playing Minecraft on FreeBSD
2010-09-20 19:09
Minecraft is an addictive cross-platform sandbox game about punching trees. With java/jdk16 installed, I attempted to run Minecraft.jar, the game launcher, on my FreeBSD amd64 desktop.
java -version java version "1.6.0_03-p4"
Java(TM) SE Runtime Environment (build 1.6.0_03-p4-nicole_17_aug_2010_02_15-b00)
Java HotSpot(TM) 64-Bit Server VM (build 1.6.0_03-p4-nicole_17_aug_2010_02_15-b00, mixed mode)
It runs and displays the login box. Attempting to log in, however, is disastrous:
java -jar Minecraft.jar Username is 'okeeblow'
java.lang.NullPointerException
at net.minecraft.GameUpdater.fatalErrorOccured(GameUpdater.java:766)
at net.minecraft.GameUpdater.loadJarURLs(GameUpdater.java:193)
at net.minecraft.GameUpdater.run(GameUpdater.java:212)
at net.minecraft.Launcher$1.run(Launcher.java:73)
Fatal error occured (2): null
java.lang.NullPointerException
at net.minecraft.GameUpdater.fatalErrorOccured(GameUpdater.java:766)
at net.minecraft.GameUpdater.loadJarURLs(GameUpdater.java:193)
at net.minecraft.GameUpdater.run(GameUpdater.java:212)
at net.minecraft.Launcher$1.run(Launcher.java:73)
I then tried java/openjdk6 .
java -version openjdk version "1.6.0"
OpenJDK Runtime Environment (build 1.6.0-b20)
OpenJDK 64-Bit Server VM (build 17.0-b16, mixed mode)
A different error.
java -jar Minecraft.jar java.net.SocketException: Invalid argument
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:310)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:176)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:163)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:384)
at java.net.Socket.connect(Socket.java:546)
at java.net.Socket.connect(Socket.java:495)
at sun.net.NetworkClient.doConnect(NetworkClient.java:178)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:409)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:530)
at sun.net.www.http.HttpClient.New(HttpClient.java:321)
at sun.net.www.http.HttpClient.New(HttpClient.java:338)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:814)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:755)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:680)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:858)
at net.minecraft.Util.excutePost(Util.java:70)
at net.minecraft.LauncherFrame.login(LauncherFrame.java:80)
at net.minecraft.LoginForm$3.actionPerformed(LoginForm.java:61)
at java.awt.Button.processActionEvent(Button.java:409)
at java.awt.Button.processEvent(Button.java:377)
at java.awt.Component.dispatchEventImpl(Component.java:4469)
at java.awt.Component.dispatchEvent(Component.java:4295)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:604)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:185)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:138)
This one, however, isn’t Minecraft’s fault. It’s a known problem with OpenJDK on FreeBSD. Forcing OpenJDK to use IPv4 with -Djava.net.preferIPv4Stack=true
then yields the same error as before.
java -Djava.net.preferIPv4Stack=true -jar Minecraft.jar Username is 'okeeblow'
java.lang.NullPointerException
at net.minecraft.GameUpdater.fatalErrorOccured(GameUpdater.java:766)
at net.minecraft.GameUpdater.loadJarURLs(GameUpdater.java:193)
at net.minecraft.GameUpdater.run(GameUpdater.java:212)
at net.minecraft.Launcher$1.run(Launcher.java:73)
Fatal error occured (2): null
java.lang.NullPointerException
at net.minecraft.GameUpdater.fatalErrorOccured(GameUpdater.java:766)
at net.minecraft.GameUpdater.loadJarURLs(GameUpdater.java:193)
at net.minecraft.GameUpdater.run(GameUpdater.java:212)
at net.minecraft.Launcher$1.run(Launcher.java:73)
Using java/linux-sun-jdk16 , audio/linux-f10-openal-soft , and enabling Linux support in x11/nvidia-driver finally lets us start and play the game as normal until Notch fixes the client.
/usr/local/linux-sun-jdk1.6.0/bin/java -jar Minecraft.jar