Compiling Sources

This page explains how to set up a development environment in a Debian based Linux version, and how to get, compile, and run Skycastle.

Prerequisites
Make sure you have the following applications installed and reachable from the command line:


 * 1) Java 1.6 or later
 * 2) Subversion
 * 3) Maven

If you are missing some of them, there are installation instructions below:

Environment set up in Ubuntu or Debian Linux
If you are using Ubuntu or another Debian based Linux, these are installation instructions for setting up the required libraries

Java 6
These should get the needed Java 6 JDK:

sudo apt-get install sun-java6-jdk sudo apt-get install sun-java6-source sudo apt-get install sun-java6-fonts

Select Java 1.6 to be the default Java version to use.

sudo update-java-alternatives -s java-6-sun

Set the JAVA_HOME variable by adding the following to /etc/bash.bashrc : (Note that you need to open a new terminal for the environment variables to update after editing bash.bashrc, or use the source command)

export JAVA_HOME=/usr/lib/jvm/java-6-sun

Test with:

java -version

Subversion
There's a Debian and Ubuntu package for subversion, just run:

sudo apt-get install subversion

Test with

svn --version

Maven
You can install Maven on Debian or Ubuntu with

sudo apt-get install maven2

Test with:

mvn --version

Checkout sources
This will download the source files for Skycastle. You don't need to have commit rights to download the sources.

Run Maven
This builds Skycastle from scratch.

Create a project for your IDE
These commands will create a working project file, with links to the downloaded dependencies. They will also download sources and javadocs for the dependencies, easing development.

Starting up a server and client in the development environment
First, make sure the current directory is the skycastle root directory (with the pom.xml and the shell scripts).

On Unix
Open a new terminal, change to the skycastle directory, and type:

On Windows
Open a new command prompt, change to the skycastle directory, and type:

Resetting the server
Once started, the server will keep the same objects on the next startup. To clear the database, and allow the server to instantiate the server from scratch, run the reset_server script or bat file.

Class incompatibility problems during development
After making changes to the code, remember to run the reset_server script, so that the changed classes will be created on the server, instead of previous serialized versions of them unserialized into the new classes.

Interactive help
Drop in to IRC and ask us if you run into other problems.

Next Step
Understanding The Source