Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
This guide will describe how to install OpenJK (Jedi Academy) and optionally OpenJO (Jedi Outcast) by compiling from this source repository.
Warning: This guide is meant for those with minimal technical expertise, as developer tools are necessary to build OpenJK. If you would like to install OpenJK from pre-built binaries, see Installing OpenJK.
Before we begin
You will need the following applications installed on your system:
- Get the source code.
- Get the dependencies.
- Run CMake to build the project files.
- Open the project files (if necessary), and compile!
Getting the source code
The source code for OpenJK, which includes Jedi Outcast and Jedi Academy, can be downloaded from the git repository:
$ git clone https://github.com/JACoders/OpenJK.git openjk
Alternatively, you can fork our project if you would like to contribute back! Either way, you must adhere to the GNU GPLv2 license, under which the original Jedi Outcast/Jedi Academy source was licensed. This means any changes to the code must be publicly available.
Getting the dependencies
The following libraries are required to build OpenJK:
- OpenAL (Windows only)
For Windows builds, all the dependencies are provided with the source code.
On Debian-based distros, the following command will download and install the required dependencies:
$ sudo apt-get install libjpeg8-dev libpng12-dev zlib1g-dev libsdl2-dev build-essential
There will be equivalent commands on other Linux distros.
For example on openSUSE you will need:
$ sudo zypper in libjpeg8-devel libpng16-devel zlib-devel libSDL2-devel
CentOS 7 for dedicated server and MP libraries
Install the dependencies:
$ sudo yum install libjpeg-devel libpng-devel zlib-devel
Run cmake with
-i to select the desired parts of OpenJK to build.
Or when cross-compiling for 32 bit:
$ sudo yum install glibc-devel.i686 libstdc++-devel.i686 libjpeg-turbo-devel.i686 libpng-devel.i686 zlib-devel.i686
Run cmake with
$ brew install zlib libjpeg libpng sdl2 --universal
zlib is installed as part of
Generating project files
We use CMake as our cross-platform makefile generator. This allows us to maintain a single set of project files, and have CMake generate the Visual Studio solution, Makefile, or Xcode project files for us. CMake can be downloaded from the CMake website, or through your package manager. Instructions for installing CMake can be found here.
There are three ways to run CMake:
CMake GUI (Windows, Linux and OS X)
This method is recommended for people using Windows, or who are new to CMake.
- Open CMake GUI
- In the "Where is the source code" text box, enter the path to the OpenJK source code.
- Copy and paste the patch into the "Where to build the binaries" text box, and add
/buildat the end of the path.
- Click the Configure button at the bottom-left of the window.
- Follow the on-screen instructions. If you don't know which compiler to use, then leave it as default.
- The window should now be filled with some settings. Edit the settings to suit your needs. We highly recommend setting
GameDatafolder to make running and testing easier later on. Hovering over each setting will give a description of what it does.
- Press the Generate button to generate the project files.
- The project files will be generated in the
build/folder located in your OpenJK source folder.
CMake Curses (Linux and OS X)
This method is recommended for people new to CMake and are comfortable using the terminal. On Linux, the curses GUI for CMake might need to be installed separately. For Debian-based distros, the package can be downloaded by running:
sudo apt-get install cmake-curses-gui
To create the project files:
cdto the OpenJK source folder and run
ccmake ..(note the double c in
- You can optionally provide the
-G <generator name>option to specify what type of project file to generate. For example:
ccmake -G Ninja ..will create project files for the Ninja build system. A list of generators can be found by running
- Configure the project (press the C key), and then edit the settings to suit your needs. We highly recommend setting
GameDatafolder to make running and testing easier later on.
- Generate the project (press the G key).
- Your project files will be created in the
- Exit the GUI by pressing the E key.
If you need to change any settings, run
make edit_cache, and the curses GUI will be shown again. Edit the settings, and generate the project again.
This method is recommended for build scripts such as those used in automated builds or for experienced users who are comfortable with using the terminal, and know the flags to pass to CMake. The following commands will create the build directory, and generate the project files for the default generator. You should edit it for your specific needs.
cd $HOME/openjk mkdir build cd build cmake ..
It is recommended to set the install prefix: `cmake -DCMAKE_INSTALL_PREFIX=/path/to/GameData ..
Compiling the source code depends on the project/makefile generated. Instructions for the main build tool on each supported platform are supplied below.
- Open the
OpenJK.slnfile in the
buildfolder with Visual Studio.
- Select the build configuration to use (Debug/Release/RelWithDebInfo/MinSizeRel).
- Build the solution.
- Built files can be found in
build/<project name>/<build configuration>/.
OpenJK makes use of some standard C/C++ headers which aren't available by default in older versions of Visual Studio. Please make sure you're running the latest version of Visual Studio!
make from the
build folder. On multicore CPUs, you can improve the speed of compilation by passing the
make -jN, Where
N is the number of cores in your CPU.
This will build all the projects. Individual projects can be built by passing the project names as arguments to
$ make openjk_sp.i386
A list of projects can be found by running
If you have set
CMAKE_INSTALL_PREFIX correctly, running
make install will copy all the built files into their correct places in your
GameData folder, ready to run and test.
Linux and multiarch builds
If you are attempting to build 32-bit binaries under 64-bit Linux, chances are you will be able to make use of multiarch support in most modern Linux distros. If you are having problems, then we suggest creating a 32-bit chroot and building inside of the chroot. This is what we do for our automated builds!
If you set the install prefix as mentioned before, you have already moved the files and can skip to the part where we rename the binaries for use in Steam.
Now that you have built binaries for the game, you can move them to the appropriate places.
- Find your Jedi Academy
GameDatafolder. If you're using Steam, it should be in
<steam folder>/steamapps/common/Jedi Academy/GameData.
- Delete all files currently in this folder with the exception of
OpenAL32.dll, and the
basefolder. (Alternatively, move them to some other place (such as a subfolder, like
_original_files) in case you need to restore the original Jedi Academy binaries).
- Move all the folders generated by compiling in the previous step to this folder. This should include files like
- You're done! You can now launch OpenJK singleplayer by running
jasp, or multiplayer by running
Some users wish to compile OpenJO (Jedi Outcast) instead of just Jedi Academy. Due to possible bugs and lack of support, OpenJO compilation is disabled by default. Additionally, there is no multiplayer OpenJO build support at this time. To enable OpenJO compilation, follow these steps:
- Edit CMakeLists.txt in the repository directory.
- Change the
BuildJK2SPRdVanillaoptions to ON.
- Follow the 'Getting the Dependencies', 'Generating Project Files', 'Compiling', and 'Installing' sections above.
- In your Jedi Outcast
GameDatafolder, delete/move all existing files except for the
- Copy the following files from the Jedi Academy
GameDatato the Jedi Outcast
openjo_sp(.exe)from the Jedi Academy
GameDatato the Jedi Outcast
GameDataand rename it to