# Minecraft-client requires new launcher



## robkoolaid (Jul 5, 2013)

Mojang has recently updated Minecraft to version 1.6. In this version, a new launcher was required. Under their downloads, they list a .jar for "Linux/Other". I can get the launcher to start up, but when I try to launch the game I get an error in the console:


```
---- YOU CAN CLOSE THIS LAUNCHER IF THE GAME STARTED OK ----
---- (We'll do this automatically later ;D) ----
Client> Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
Client> 	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1681)
Client> 	at java.lang.Runtime.loadLibrary0(Runtime.java:840)
Client> 	at java.lang.System.loadLibrary(System.java:1047)
Client> 	at org.lwjgl.Sys$1.run(Sys.java:73)
Client> 	at java.security.AccessController.doPrivileged(Native Method)
Client> 	at org.lwjgl.Sys.doLoadLibrary(Sys.java:66)
Client> 	at org.lwjgl.Sys.loadLibrary(Sys.java:95)
Client> 	at org.lwjgl.Sys.<clinit>(Sys.java:112)
Client> 	at atn.F(SourceFile:1851)
Client> 	at net.minecraft.client.main.Main.main(SourceFile:37)
Game ended with bad state (exit code 1)
Deleting /root/minecraft/versions/1.6.1/1.6.1-natives-74549643453801
```

I'm stumped as to what to do.


----------



## Terry_Kennedy (Jul 5, 2013)

robkoolaid said:
			
		

> Mojang has recently updated Minecraft to version 1.6. In this version, a new launcher was required. Under their downloads, they list a .jar for "Linux/Other". I can get the launcher to start up, but when I try to launch the game I get an error in the console:
> 
> 
> ```
> ...


lwjgl seems to be Lightweight Java Game Library. That project's FAQ page gives some pointers on fixing this error.


----------



## robkoolaid (Jul 5, 2013)

Thanks for replying. 

Before posting this thread, I had already been to that page and tried following the first step. I wasn't really sure what to put for the path though. I tried /usr/local/lib, /usr/local/lib/lwjgl2.7.1, ~/lwjgl-2.9.0/jar/, ~/lwjgl-2.9.0/natives.


----------



## cpm@ (Jul 5, 2013)

The problem has been reported. See ports/180195 for details.


----------



## robkoolaid (Jul 5, 2013)

Thanks for letting me know! How would one go about applying the patch.txt mentioned at that location?


----------



## cpm@ (Jul 5, 2013)

You need to wait to be fixed, after that, just sync your ports tree and update as usual. Please, read the original message, which reports the same problem that you have, and probably also, others.

Manually, you can do the following:

```
# cd /usr/ports/games/minecraft-client
# fetch -o minecraft-client.txt 'http://www.freebsd.org/cgi/query-pr.cgi?pr=180195;cat=&getpatch=3'
# patch < minecraft-client.txt
# make deinstall clean install clean
```


----------



## robkoolaid (Jul 6, 2013)

Hi, whenever I do `patch -p0 < minecraft-client.txt` it says

```
Hmm.. Looks like a unified diff to me...
The text leading up to this was:
-------------------------------
|Index: games/minecraft-client/Makefile
|===========================================================
|--- games/minecraft-client/Makefile    (revision 322328)
|+++ games/minecraft-client/Makefile    (working copy)
----------------------------
File to patch: _
```
and it keeps asking me to patch all these file things. I have no idea what to do.


----------



## robkoolaid (Jul 6, 2013)

Ah, I took off the -p0 and it worked. Sorry.


----------



## cpm@ (Jul 6, 2013)

```
Hmm.. Looks like a unified diff to me...
The text leading up to this was:
-------------------------------
|Index: games/minecraft-client/Makefile
|===========================================================
|--- games/minecraft-client/Makefile    (revision 322328)
|+++ games/minecraft-client/Makefile    (working copy)
----------------------------
File to patch: _
```

Type the filename to patch, in this case, Makefile or set the correct pathname strip count. Read patch(1)() man page.


----------



## Amzo (Jul 8, 2013)

Here is the launcher I use, it's an improved version of the one ports uses: http://sprunge.us/KOhJ

Of course you'll have to update the $JAVA_DATA variable to point to the FreeBSD location.

I wrote this for ArchBSD, which is pure FreeBSD, just changed the paths to be the same as ArchLinux. It will work though.

Oh I spoke too soon. I'll write a new wrapper for Minecraft 1.6 but it seems like it performs checks on the libraries and if they're not the ones provided by Minecraft, it automatically downloads them again. We probably need to find out where it does the checks and add our own md5sum or whatever it uses for verification.


----------



## robkoolaid (Jul 10, 2013)

Hello there. Checking that link you sent earlier, I applied the latest patch. It seems to have applied OK. Then I did `make deinstall clean install clean` with the following result:

```
===>  Deinstalling for games/minecraft-client
===>   minecraft-client not installed, skipping
===>  Cleaning for minecraft-client-1.6.2
===>  Found saved configuration for minecraft-client-1.0.0
===> Fetching all distfiles required by minecraft-client-1.6.2 for building
===>  Extracting for minecraft-client-1.6.2
=> SHA256 Checksum OK for minecraft-client/1.6.2/Minecraft.jar.
=> SHA256 Checksum OK for minecraft-client/1.6.2/Grass.png.
===>  Patching for minecraft-client-1.6.2
===>   minecraft-client-1.6.2 depends on file: /usr/local/share/java/classes/lwjgl/lwjgl_util.jar - found
===>   minecraft-client-1.6.2 depends on shared library: openal.1 - found
===>  Configuring for minecraft-client-1.6.2
===>  Installing for minecraft-client-1.6.2
===>   minecraft-client-1.6.2 depends on file: /usr/local/share/java/classes/lwjgl/lwjgl_util.jar - found
===>   minecraft-client-1.6.2 depends on file: /usr/local/openjdk7/bin/java - found
===>   Generating temporary packing list
===>  Checking if games/minecraft-client already installed
added manifest
adding: liblwjgl.so(in = 372156) (out= 77346)(deflated 79%)
adding: libopenal.so(in = 282608) (out= 143928)(deflated 49%)
*** [do-install] Error code 71

Stop in /usr/ports/games/minecraft-client.
*** [install] Error code 1

Stop in /usr/ports/games/minecraft-client.

install: /usr/ports/games/minecraft-client/files/minecraft-client: No such file or directory
```

Any ideas?


----------



## cpm@ (Jul 11, 2013)

Seems that the latest patch doesn't applied correctly. You need reversed the previous patch and apply the latest one which creates the missing minecraft-client file:

```
#!/bin/sh
export JAVA_HOME=JAVA_HOME
/bin/cat << EOF
When starting a version for the first time, select the version you want in your
profile, start Minecraft, close Minecraft and launcher, run minecraft-client
again, then select version "x-freebsd" in your profile."

If you run versions older than 1.6.1 in the Launcher, add
-Djava.net.preferIPv4Stack=true to JVM Arguments in the profile.

EOF
LIBDIR="${HOME}/.minecraft/libraries/"

for i in ${LIBDIR}/org/lwjgl/lwjgl/lwjgl-platform/*/lwjgl-platform-*-natives-linux.jar; do
  if [ -f "${i}" ]; then
    cmp -s "PREFIX/share/minecraft-client/lwjgl-native-libs.jar" "${i%linux.jar}freebsd.jar"
    if [ $? -ne 0 ]; then
      cp -v "PREFIX/share/minecraft-client/lwjgl-native-libs.jar" "${i%linux.jar}freebsd.jar"
    fi
  fi
done

versions_base="${HOME}/.minecraft/versions"

for i in ${HOME}/.minecraft/versions/*; do
  if [ "${i}" != "${i%-freebsd}" ]; then continue; fi
  OLDIFS=$IFS
  IFS=/
  for x in ${i}; do
    version="${x}"
  done
  IFS=${OLDIFS}

  native_path="${versions_base}/${version}-freebsd/"
  mkdir -p "${native_path}"

  vendor_file="${versions_base}/${version}/${version}"
  native_file="${native_path}/${version}-freebsd"

  if [ -f "${vendor_file}.jar" -a ! -f "${native_file}.jar" ]; then
    cp -v "${vendor_file}.jar" "${native_file}.jar"
  fi
  if [  -f "${vendor_file}.json" -a ! -f "${native_file}.json" ]; then
    sed -e '/"id"/s/",/-freebsd",/' -e '/lwjgl/,/extract/s/natives-linux/natives-freebsd/' \
    < "${vendor_file}.json" > "${native_file}.json"
  fi
done

exec JAVA_CMD -Djava.nio.file.spi.DefaultFileSystemProvider=sun.nio.fs.BsdFileSystemProvider \
 -Dos.name=Linux -jar PREFIX/share/minecraft-client/Minecraft.jar
```

The startup script should be placed in /usr/ports/games/minecraft-client/files/ directory.


----------



## robkoolaid (Jul 12, 2013)

The latest patch is the one I installed, number 4, so that's not an option. What is this thing you pasted? It doesn't look like one of those patch files. Anyway, I reversed the patch and tried whatever you pasted, as a patch. It compiled as 1.4.6_1 again, under that patch. I'm lost. Haha, sorry.

Edit:

OK, I tried what you said and it's still not working. It compiles okay, but I can't run the game. I get these errors:


```
Exception in thread "main" java.lang.AssertionError: java.lang.ClassNotFoundException: sun/nio/fs/LinuxFileSystemProvider
	at sun.nio.fs.DefaultFileSystemProvider$1.run(DefaultFileSystemProvider.java:49)
	at sun.nio.fs.DefaultFileSystemProvider$1.run(DefaultFileSystemProvider.java:43)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.nio.fs.DefaultFileSystemProvider.createProvider(DefaultFileSystemProvider.java:42)
	at sun.nio.fs.DefaultFileSystemProvider.create(DefaultFileSystemProvider.java:70)
	at java.nio.file.FileSystems$DefaultFileSystemHolder.getDefaultProvider(FileSystems.java:108)
	at java.nio.file.FileSystems$DefaultFileSystemHolder.access$000(FileSystems.java:89)
	at java.nio.file.FileSystems$DefaultFileSystemHolder$1.run(FileSystems.java:98)
	at java.nio.file.FileSystems$DefaultFileSystemHolder$1.run(FileSystems.java:96)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.nio.file.FileSystems$DefaultFileSystemHolder.defaultFileSystem(FileSystems.java:95)
	at java.nio.file.FileSystems$DefaultFileSystemHolder.<clinit>(FileSystems.java:90)
	at java.nio.file.FileSystems.getDefault(FileSystems.java:176)
	at java.io.File.toPath(File.java:2069)
	at sun.font.FcFontConfiguration.writeFcInfo(FcFontConfiguration.java:391)
	at sun.font.FcFontConfiguration.init(FcFontConfiguration.java:100)
	at sun.font.FcFontConfiguration.<init>(FcFontConfiguration.java:75)
	at sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:747)
	at sun.font.SunFontManager$2.run(SunFontManager.java:430)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.font.SunFontManager.<init>(SunFontManager.java:375)
	at sun.awt.X11FontManager.<init>(X11FontManager.java:32)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
	at java.lang.Class.newInstance0(Class.java:372)
	at java.lang.Class.newInstance(Class.java:325)
	at sun.font.FontManagerFactory$1.run(FontManagerFactory.java:83)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74)
	at sun.font.SunFontManager.getInstance(SunFontManager.java:249)
	at sun.font.FontDesignMetrics.getMetrics(FontDesignMetrics.java:264)
	at sun.swing.SwingUtilities2.getFontMetrics(SwingUtilities2.java:1012)
	at javax.swing.JComponent.getFontMetrics(JComponent.java:1624)
	at javax.swing.text.WrappedPlainView.updateMetrics(WrappedPlainView.java:318)
	at javax.swing.text.WrappedPlainView.setSize(WrappedPlainView.java:381)
	at javax.swing.plaf.basic.BasicTextUI$RootView.setSize(BasicTextUI.java:1714)
	at javax.swing.plaf.basic.BasicTextUI.getPreferredSize(BasicTextUI.java:917)
	at javax.swing.plaf.basic.BasicTextAreaUI.getPreferredSize(BasicTextAreaUI.java:120)
	at javax.swing.JComponent.getPreferredSize(JComponent.java:1660)
	at javax.swing.JTextArea.getPreferredSize(JTextArea.java:619)
	at javax.swing.ScrollPaneLayout.layoutContainer(ScrollPaneLayout.java:790)
	at java.awt.Container.layout(Container.java:1503)
	at java.awt.Container.doLayout(Container.java:1492)
	at java.awt.Container.validateTree(Container.java:1688)
	at java.awt.Container.validateTree(Container.java:1697)
	at java.awt.Container.validateTree(Container.java:1697)
	at java.awt.Container.validateTree(Container.java:1697)
	at java.awt.Container.validateTree(Container.java:1697)
	at java.awt.Container.validate(Container.java:1623)
	at java.awt.Container.validateUnconditionally(Container.java:1660)
	at java.awt.Window.show(Window.java:1033)
	at java.awt.Component.show(Component.java:1651)
	at java.awt.Component.setVisible(Component.java:1603)
	at java.awt.Window.setVisible(Window.java:1014)
	at net.minecraft.bootstrap.Bootstrap.<init>(Bootstrap.java:65)
	at net.minecraft.bootstrap.Bootstrap.main(Bootstrap.java:364)
Caused by: java.lang.ClassNotFoundException: sun/nio/fs/LinuxFileSystemProvider
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:264)
	at sun.nio.fs.DefaultFileSystemProvider$1.run(DefaultFileSystemProvider.java:47)
	... 57 more
```


----------



## cpm@ (Jul 12, 2013)

Reinstall java/openjdk7 and try again. Please, submit a follow-up to the PR.


----------



## robkoolaid (Jul 12, 2013)

It works! Thanks so much for all of the help you provided, @cpu82!


----------



## Chiron (Jul 18, 2013)

Hi,

*I* have a little problem, and I hope you can help. Getting the new launcher to work drives me crazy.


```
root@niobe:/usr/ports/games/minecraft-client # fetch -o minecraft-client.txt 'http://www.freebsd.org/cgi/query-pr.cgi?pr=180195;cat=&getpatch=3'
fetch: http://www.freebsd.org/cgi/query-pr.cgi?pr=180195;cat=&getpatch=3: size of remote file is not known
minecraft-client.txt                                    12 kB   35 kBps
root@niobe:/usr/ports/games/minecraft-client #
```


```
root@niobe:/usr/ports/games/minecraft-client # patch < minecraft-client.txt
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Index: games/minecraft-client/Makefile
|===================================================================
|--- games/minecraft-client/Makefile	(revision 322328)
|+++ games/minecraft-client/Makefile	(working copy)
--------------------------
Patching file Makefile using Plan A...
Hunk #1 succeeded at 2 with fuzz 1.
Hunk #2 succeeded at 21.
Hunk #3 succeeded at 33.
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Index: games/minecraft-client/distinfo
|===================================================================
|--- games/minecraft-client/distinfo	(revision 322328)
|+++ games/minecraft-client/distinfo	(working copy)
--------------------------
Patching file distinfo using Plan A...
Hunk #1 succeeded at 1.
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Index: games/minecraft-client/pkg-descr
|===================================================================
|--- games/minecraft-client/pkg-descr	(revision 322328)
|+++ games/minecraft-client/pkg-descr	(working copy)
--------------------------
Patching file pkg-descr using Plan A...
Hunk #1 succeeded at 1.
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Index: games/minecraft-client/pkg-plist
|===================================================================
|--- games/minecraft-client/pkg-plist	(revision 322328)
|+++ games/minecraft-client/pkg-plist	(working copy)
--------------------------
Patching file pkg-plist using Plan A...
Hunk #1 succeeded at 1.
done
root@niobe:/usr/ports/games/minecraft-client #
```


```
root@niobe:/usr/ports/games/minecraft-client # make install clean
===>  Found saved configuration for minecraft-client-1.4.6_1
===>   minecraft-client-1.6.1 depends on file: /usr/local/sbin/pkg - found
=> Minecraft.jar doesn't seem to exist in /usr/ports/distfiles/minecraft-client/1.6.1.
=> Attempting to fetch https://s3.amazonaws.com/Minecraft.Download/launcher/Minecraft.jar
fetch: https://s3.amazonaws.com/Minecraft.Download/launcher/Minecraft.jar: size mismatch: expected 82803, actual 280212
=> Attempting to fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/minecraft-client/1.6.1/Minecraft.jar
fetch: ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/minecraft-client/1.6.1/Minecraft.jar: File unavailable (e.g., file not found, no access)
=> Couldn't fetch it - please try to retrieve this
=> port manually into /usr/ports/distfiles/minecraft-client/1.6.1 and try again.
*** [do-fetch] Error code 1

Stop in /usr/ports/games/minecraft-client.
*** [install] Error code 1

Stop in /usr/ports/games/minecraft-client.
root@niobe:/usr/ports/games/minecraft-client #
```

When *I* download the .jar manually, and put it to /usr/ports/distfiles/minecraft-client/1.6.1 *I* got this: 
	
	



```
SHA256 Checksum mismatch for minecraft-client/1.6.1/Minecraft.jar.
```

With `make install NO_CHECKSUM=yes`, it can be installed, launcher starts and then *I* get this error:

```
Couldn't download https://s3.amazonaws.com/Minecraft.Download/libraries/org/lwjgl/lwjgl/lwjgl-platform/2.9.0/lwjgl-platform-2.9.0-natives-freebsd.jar for job 'Version & Libraries'
```

_The_ ports collection is up to date, reinstalling openjdk7 didn*'*t help and honestly *I* don*'*t know what to with the startup script*.*


```
(exec JAVA_CMD -not found)
```
 What am *I* doing wrong?


----------



## cpm@ (Jul 18, 2013)

Hi @Chiron,

There is a new version of the port. To update you need to apply the fourth patch:
`# fetch -o minecraft-client.txt 'http://www.freebsd.org/cgi/query-pr.cgi?pr=180195;cat=&getpatch=4'`

For more details see ports/180195.

P.S. Everytime a file is fetched and its checksum changed, just run `# make makesum` to generate the corresponding distinfo file. In your case:

```
# cd /usr/ports/games/minecraft-client/ && make makesum
```


----------



## Chiron (Jul 18, 2013)

Hi,

I still get 


```
# SHA256 Checksum mismatch for minecraft-client/1.6.2/Minecraft.jar.
```
but itÂ´s now running fine. Thank you 

PS: Sorry for bad formatting at first post.


----------



## dominik (Nov 9, 2013)

I have still trouble getting minecraft-client on freebsd FreeBSD 9.2 amd64 to work. I ap*p*lied the fifth patch but I still get this error: 


```
wnloading: https://s3.amazonaws.com/Minecraft.Download/launcher/launcher.pack.lzma
Didn't find an update in time.
Reversing LZMA on /root/.minecraft/launcher.pack.lzma to /root/.minecraft/launcher.pack
Unpacking /root/.minecraft/launcher.pack to /root/.minecraft/launcher.jar
Cleaning up /root/.minecraft/launcher.pack
Starting launcher.
resourceUrl = https://s3.amazonaws.com/Minecraft.Resources/
[16:07:57 INFO]: Refreshing local version list...
[16:07:57 INFO]: Minecraft Launcher 1.3.1 (through bootstrap 5) started on linux...
[16:07:57 INFO]: Current time is Nov 9, 2013 4:07:57 PM
[16:07:57 INFO]: System.getProperty('os.name') == 'Linux'
[16:07:57 INFO]: System.getProperty('os.version') == '9.2-RELEASE'
[16:07:57 INFO]: System.getProperty('os.arch') == 'amd64'
[16:07:57 INFO]: System.getProperty('java.version') == '1.7.0_25'
[16:07:57 INFO]: System.getProperty('java.vendor') == 'Oracle Corporation'
[16:07:57 INFO]: System.getProperty('sun.arch.data.model') == '64'
[16:07:57 INFO]: Refreshing remote version list...
Got reply in: 18235ms
No update found.
[16:08:03 INFO]: Refresh complete.
[16:08:03 INFO]: Loaded 1 profile(s); selected 'HARL0R'
[16:08:03 INFO]: Refreshing auth...
[16:08:03 INFO]: Logging in with access token
resourceUrl = https://s3.amazonaws.com/Minecraft.Resources/?marker=sounds/mob/villager/
[16:08:24 INFO]: Download job 'Resources' skipped as there are no files to download
-- 
[16:08:24 INFO]: Job 'Resources' finished successfully
[16:09:34 INFO]: Getting syncinfo for selected version
[16:09:34 INFO]: Queueing library & version downloads
...
[16:09:41 INFO]: Job 'Version & Libraries' finished successfully
[16:09:41 INFO]: Launching game
[16:09:41 INFO]: Looking for old natives to clean up...
[16:09:41 INFO]: Unpacking natives to /root/.minecraft/versions/1.7.2/1.7.2-natives-19710535885806
[16:09:41 INFO]: Launching in /root/.minecraft
[16:09:45 INFO]: Client> Exception in thread "main" java.lang.UnsatisfiedLinkError: /root/.minecraft/versions/1.7.2/1.7.2-natives-19710535885806/liblwjgl.so: /root/.minecraft/versions/1.7.2/1.7.2-natives-19710535885806/liblwjgl.so: unsupported file layout (Possible cause: architecture word width mismatch)
[16:09:45 INFO]: Client>        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
[16:09:45 INFO]: Client>        at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1957)
[16:09:45 INFO]: Client>        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1882)
[16:09:45 INFO]: Client>        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1872)
[16:09:45 INFO]: Client>        at java.lang.Runtime.loadLibrary0(Runtime.java:849)
[16:09:45 INFO]: Client>        at java.lang.System.loadLibrary(System.java:1087)
[16:09:45 INFO]: Client>        at org.lwjgl.Sys$1.run(Sys.java:73)
[16:09:45 INFO]: Client>        at java.security.AccessController.doPrivileged(Native Method)
[16:09:45 INFO]: Client>        at org.lwjgl.Sys.doLoadLibrary(Sys.java:66)
[16:09:45 INFO]: Client>        at org.lwjgl.Sys.loadLibrary(Sys.java:95)
[16:09:45 INFO]: Client>        at org.lwjgl.Sys.<clinit>(Sys.java:112)
[16:09:45 INFO]: Client>        at azd.J(SourceFile:2064)
[16:09:45 INFO]: Client>        at net.minecraft.client.main.Main.main(SourceFile:36)
[16:09:45 ERROR]: java.io.IOException: Stream closed
[16:09:45 ERROR]: java.io.IOException: Stream closed
```

I already tried to install openjdk7 again what didn't help either.


----------

