Posts tagged: howto

X-COM: UFO Defense, Steam, and DOSBox

I recently purchased the X-COM: Complete Pack during the Steam Perils of Summer sale, and of course I wanted to run the game in my Ubuntu (10.04) partition. Turns out it’s really easy. Steam runs the game in DOSBox, and DOSBox is available natively in Ubuntu.

First, I’ll assume you’ve already got access to the Steam-installed version of the game (either through Steam running in Wine or Steam on a Windows partition). I copied the XCOM game directory to a convenient location. You can find the XCOM directory at wherever your Steam install is…

Steam/steamapps/common/xcom ufo defense/XCOM

and I copied that to


You can do the same from the command line, assuming you have a Wine-installed version of Steam, by copying the entire block below and pasting it into a console. Don’t mind if the text runs further than this window allows. The entire command should copy when selected.

cp -r \
/home/myaccount/.wine/drive_c/Program\ Files/Steam/steamapps/common/xcom\ ufo\ defense/XCOM/ \

Now install DOSBox. From the command line,

sudo aptitude install dosbox

When that’s done, run dosbox from the command line.


Or from the Applications bar.

Applications > Games > DOSBox Emulator

This will open the DOSBox window. You’ll notice it mounts the ‘z’ drive by default. We want to mount the ‘c’ drive, which as you’ll recall we created in /home/myaccount/Games/dos/c/

In DOSBox type

mount c /home/myaccount/Games/dos/c/

And change the focus to the c drive by typing


Now we just navigate to the XCOM directory.


and run the game


And that’s it! Just don’t ask me how to play the game because I’ve got no idea. (It drops you onto the globe and doesn’t give you any hint what you’re supposed to do next).

In a similar case, you could use the same method to run the original DOOM when purchased in Steam, or even Commander Keen.

Slick, Phys2D, LWJGL, and Eclipse

This guide will be as straight-to-the-point as can be. Please note, I make an example of the Linux version in this setup, but you can substitute the instructions for Windows or Mac if that is what you use.


Create an Eclipse project that uses Slick, Phys2D and LWJGL.


  1. Slick – website – Download the “full distribution” (~ 9.8 MB)
  2. LWJGL – website – I prefer to use the “last stable build” from the project repository (currently 2.2.0, ~ 3.6 MB)
  3. Phys2D – website – Download the latest build (current build 2008-04-06, ~ 100 KB)


This is a personal preference, but I rename the Phys2D download. It downloads as phys2d-060408.jar, so I rename it phys2d.jar.

Next, extract/unzip the file, it doesn’t matter where. We will import the files into the Eclipse workspace later anyway.

Open up Eclipse and start a new project.

File >> New >> Java Project

Presumably, you know your way around Eclipse so I will not help with the specifics of creating a project.

Now that the project is created, create a new folder called lib in the project.

File >> New >> Folder
Click the project name
Folder name: lib

Next, we import Slick and Phys2D into the project.

Right click lib >> Left click Import >> General >> File System >> Next
Browse to the unzipped slick directory and find the slick/lib folder >> OK
Select the following jar files
  • jogg-0.0.7.jar
  • jorbis-0.0.15.jar
  • lwjgl.jar
  • slick.jar
Click Finish

You’ve imported Slick, now we import Phys2D.

Right click lib >> Import >> General >> File System >> Next
Browse to the location you put phys2d.jar >> OK
Select phys2d.jar >> Finish

Now your lib folder should have those five jar files in them. Just about done.

We need to add the jar files into the project build path.

Right click the Project >> Properties
On the left, make sure Java Build Path is selected.
Click the Libraries tab >> Add JARs
Expand the Project
Expand lib
Select all of the jar files in the lib directory >> OK >> OK

You should now see a new directory in the Package Explorer called Referenced Libraries. The project is incomplete without first attaching the native libraries to lwjgl.jar. To do that, we first import those native libraries into the project.

Right click lib >> Import >> General >> Archive File
Browse to the unzipped slick directory and
select slick/lib/natives-linux.jar >> OK >> Finish
Do the same for natives-win32.jar and natives-mac.jar
(if you wish to support those operating systems)

Next, we attach those native libraries to the lwjgl.jar file.

Expand Referenced Libraries
Right click lwjgl.jar >> Properties
Select Native Library at the left of that window
Location path: >> Workspace
Expand the Project
Select lib >> OK >> Apply >> OK

Now you are ready to build your awesome game.

But wait, what about using the latest version of lwjgl? We skipped that step.

Right. We did. As of right now, we’re using the the version of LWJGL that came packaged with Slick. However, some users might run into a problem with LWJGL, particularly if you’re using Ubuntu 9.04 (like I am). At this point, if I were to try to compile a Slick program, I would end up with this error:

Failed to initialise the LWJGL display

The solution to which is to use the latest LWJGL native Linux libraries.

Extract that last stable build of LWJGL that you downloaded (
In Eclipse, Right click lib >> Import >> File System >> Next
Browse to the unzipped lwjgl-2.2.0 directory, to lwjgl-2.2.0/native/linux >> OK
Select all of the .so files (all of the files in the directory) >> Finish
Yes To All when asked to overwrite files

Not entirely done yet. Trying to compile now would result in the following error:

Version mismatch: jar version is '16', native libary version is '17'

So we replace the old lwjgl.jar with the new. Find it at lwjgl-2.2.0/jar/lwjgl.jar. Import it into the lib folder of the project. You know how to do that by now. Compile and run again and all should be well.

P.S. You are done with all the extra unzipped directories and zip files, etc. Everything needed to run your project has been imported into Eclipse. They can be deleted if you so choose.

Update: It seems that now there is an additional problem, as follows.

java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path

The solution was found at the jMonkeyEngine forums. You need to tell the lwjgl.jar where it can find the native libraries so it can run. Basically it calls for

Right click the project >> Properties >> Java Build Path >> Libraries
Expand lwjgl.jar
Select Native Library >> Edit
Click Workspace
Expand the project
Click lib >> OK >> OK

Staypressed theme by Themocracy