PokerApp Home | Forum | Help / FAQ |
Download | Development | SourceForge Project Page |
The PokerApp server can be run from a Linux console (without a window manager) - using a command like java -jar PokerApp.jar --server --port=##### --nogui. This can be very useful to start a server on a remote Linux machine by accessing it via PuTTY or some other remote terminal program.
However, because of the way Java loads the java.awt classes, an X server must be present or you will get an error:
Exception in thread "main" java.lang.InternalError: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.
This can be overcome, but it requires starting an X server with a virtual frame buffer (rather than using the screen as a frame buffer). A program called Xvfb can do just this. Xvfb is usually an optional part of a standard X installation, so there is a good chance you might have to follow these instructions to install it.
Getting / Installing Xvfb
First thing: Make sure its not already installed - if the file Xvfb doesn't exist anywhere, then its not installed. It will probably be in the same directory as your X executable. ($X11_DIRECTORY/bin/Xvfb)
If you have it, check out "Running Xvfb" below. If you don't have it, keep reading here...
If you already have an X server installed:
First check your Linux distribution. This is the easiest thing to do. I installed the Xvfb package right off the Slackware CD-ROM. You can also check the distribution's website for the latest versions. Once you find the package, follow your distribution's procedure for installing packages. Most likely this package will be on one of the distribution's CD-ROMs. If not you will have to get it from the website.
If you can't find a package for Xvfb for your distribution, you can get it from Xfree86 and install it using their scripts.
Go to http://ftp.xfree86.org/pub/XFree86/4.6.0/binaries/ to download the 4.6 version. If you have an earlier or later version, you can change 4.6.0 to whatever you may have.
Now go to the proper directory (ex. Linux-ix86-glibc23/) and download Xvfb.tgz and extract.
Use the following commands to install Xvfb
chmod +x extract (makes the extract script executable)
./extract -C /usr/X11R6 Xvfb (if you X installation is under something else like /usr/local, make the obvious change to that command)
If you don't have an X server installed:
You must install X first. The good news is that if you can install the X server, installing Xvfb is just adding one more piece to that.
You can try to install X from your distribution. Follow the instructions from your distribution on how to do this from the CD-ROM or from downloaded packages. Remember to install the Xvfb package along with the rest of the X packages.
If you cannot or do not want to install X from your distribution, you can install Xfree86 by downloading and installing X from Xfree86. Follow the instructions on that site for installing X. To install Xvfb, simply download and install Xvfb.tgz as part of the installation process.
Running Xvfb and starting the PokerApp server
Running Xvfb is pretty simple once you have it installed. Just use the following commands
export DISPLAY=localhost:99.0
This sets the DISPLAY environment variable - you don't have to use 99 for the display, that's just a display that probably won't be in use.
/usr/X11R6/bin/Xvfb :99 -screen 0 1x1x8 &
This starts Xvfb. If Xvfb is located someplace different that the path I specified, then use your path. ":99" is the display to use - same number as the export DISPLAY command above. "-screen 0 1x1x8" tells Xvfb to create screen zero with a resolution of 1x1 pixel with 8 bits of color. You don't need a bigger screen since it actually won't be trying to draw to the screen. "&" makes it run in the background so you can now start the PokerApp server. After you type this you will get some messages (same ones you would get had you tried to start X with a window manager). Simply press enter and type in the next command to start PokerApp.
java -jar PokerApp.jar --server --port=##### --nogui
You should get confirmation that the PokerApp server has started: "Opened server on port #####"
To stop the PokerApp server and Xvfb, do the following:
If you have any questions, post them to the PokerApp forum - other folks who have done the same thing as you may be able to help.