Linux: Difference between revisions

From PZwiki
No edit summary
No edit summary
Line 4: Line 4:


You need to [https://help.ubuntu.com/community/Repositories/Ubuntu#Adding%20Canonical%20Partner%20Repositories enable the "partner" repository] in "Software Sources" and then see the [https://help.ubuntu.com/community/Java#Sun%20Java Ubuntu wiki page about Java]
You need to [https://help.ubuntu.com/community/Repositories/Ubuntu#Adding%20Canonical%20Partner%20Repositories enable the "partner" repository] in "Software Sources" and then see the [https://help.ubuntu.com/community/Java#Sun%20Java Ubuntu wiki page about Java]
==Gentoo==
There are instructions to run the demo on gentoo box. The demo does not have native libraries distributed with it, so you need to install them manually. You need to add overlay "java-overlay" ''layman -a java-overlay'' then ''emerge -av lwjgl''. Create a script in the directory you've extracted the demo having following lines in it:
#!/bin/sh
exec java -Xmx512m -Djava.library.path=/usr/lib/lwjgl-2.7/:/usr/lib/jinput/ -Dsun.java2d.noddraw=true -Dsun.awt.noerasebackground=true \
-Dsun.java2d.d3d=false -Dsun.java2d.opengl=false -Dsun.java2d.pmoffscreen=false -cp .:zombie.jar:lwjgl.jar:lwjgl_util.jar zombie.FrameLoader


==Playing outside the browser==
==Playing outside the browser==

Revision as of 11:24, 13 September 2011

Project Zomboid has been made to run on Linux. However, as Sun's official Java and the Java browser plugin do not come pre-installed, if you do not already then you shall have to download and install yourself.

Ubuntu

You need to enable the "partner" repository in "Software Sources" and then see the Ubuntu wiki page about Java

Gentoo

There are instructions to run the demo on gentoo box. The demo does not have native libraries distributed with it, so you need to install them manually. You need to add overlay "java-overlay" layman -a java-overlay then emerge -av lwjgl. Create a script in the directory you've extracted the demo having following lines in it:

#!/bin/sh
exec java -Xmx512m -Djava.library.path=/usr/lib/lwjgl-2.7/:/usr/lib/jinput/ -Dsun.java2d.noddraw=true -Dsun.awt.noerasebackground=true \
-Dsun.java2d.d3d=false -Dsun.java2d.opengl=false -Dsun.java2d.pmoffscreen=false -cp .:zombie.jar:lwjgl.jar:lwjgl_util.jar zombie.FrameLoader

Playing outside the browser

There are at least two reasons why you would want to play the standalone rather than in-browser. First, Java and Linux don't mix that well and is quite unstable in any browser. Second, there is a focus problem with the game inside a browser currently which does not occur in the standalone version.

At any rate, you need to first login inside a browser to download the game. This only works once you have first logged in with your account and downloaded.

Create a file which has these three lines in it:

#!/bin/sh
DATA=$HOME/.java/deployment/cache/lwjglcache/cloud.projectzomboid.com/ProjectZomboid
java -Djava.library.path=$DATA/natives -cp $DATA/zombie.jar:$DATA/lwjgl.jar:$DATA/lwjgl_util.jar zombie.GameWindow

Call it "projectzomboid" or whatever you want. Make it executable (chmod +x projectzomboid) and run it (./projectzomboid).

Worth noting is that the standalone is currently limited to one resolution only, 1440x900, and is NOT officially supported and does not have auto-update feature in it. You always need to use the browser to update the game.

Alternate Method

I didn't have much success with the above script, so I improvised. First I installed liblwjgl-java. I then copied

cp /usr/share/java/lwjgl{,_util}.jar ./

over top of the included lwjgl files - replacing them. Running was then the simple matter of

java -cp zombie.jar zombie.GameWindow.

I ended up throwing in a -Xms1024m -Xmx1024m as well. Good Luck.

Manual install

First, go here and download java. You want the normal Linux file, NOT the RPM. If you have a 64-bit computer, get the x64 version. You must now extract the file. The easiest way to do this is to take the downloaded file, place it in the home directory, rename it to "java.bin", and open the terminal and type in "bash java.bin". This will install Java.

Now, you need to install the Java plugin. Oracle's installation instructions say thusly, and these instructions work, but only on a 32-bit computer.

This is a problem for those of us who have a 64-bit computer, as the 32-bit plugin path is different from the 64-bit path. Be sure that you downloaded the x64 version if you have a 64 bit computer.

So, once java is installed, pull up the terminal again. cd to your firefox plugin directory, unless you moved it the command will be: cd /usr/lib/mozilla/plugins

Then you need to create a symbolic link to the java plugin. In that same terminal window, now type one of the following depending on the type of computer you have:

If you have a 32-bit computer:

close firefox, then type:

sudo ln -s /home/<username>/<Java installation directory>/lib/i386/libnpjp2.so

Filling in the appropriate blanks. For example, to install, the author of this page wrote:

sudo ln -s /home/peter/jre1.6.0_24/lib/i386/libnpjp2.so

Be sure to check your installation directory, it will change depending on the version of java you have.

If you have a 64-bit computer:

close firefox, then type:

sudo ln -s /home/<username>/<Java installation directory>/lib/amd64/libnpjp2.so

Filling in the appropriate blanks. For example, to install, the author of this page wrote:

sudo ln -s /home/peter/jre1.6.0_24/lib/amd64/libnpjp2.so

Be sure to check your installation directory, it will change depending on the version of java you have.


To Double Check

Then, open a file explorer window, and go to usr/lib/mozilla/plugins, and be sure that the link is in the proper place. If it is, you should be all set. Head off to the website. If it isn't, delete it. You may need to use the terminal to do so, the command will be: sudo rm <filepath> Then check your steps and try again. If you continue to have trouble, go to the forums and send a pm to rdsqc22. Also try google.