Compiling Sources
From Skycastle
This page explains how to set up a development environment in a Debian based Linux version, and how to get, compile, and run Skycastle.
Contents |
[edit] Prerequisites
Make sure you have the following applications installed and reachable from the command line:
If you are missing some of them, there are installation instructions below:
[edit] 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
[edit] 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
[edit] Subversion
There's a Debian and Ubuntu package for subversion, just run:
sudo apt-get install subversion
Test with
svn --version
[edit] Maven
You can install Maven on Debian or Ubuntu with
sudo apt-get install maven2
Test with:
mvn --version
[edit] Checkout sources
This will download the source files for Skycastle. You don't need to have commit rights to download the sources.
svn co https://skycastle.svn.sourceforge.net/svnroot/skycastle/trunk/skycastle skycastle
[edit] Run Maven
This builds Skycastle from scratch.
mvn clean install
[edit] 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.
[edit] For IntelliJ IDEA
mvn idea:idea -DdownloadSources=true -DdownloadJavadocs=true
[edit] For Eclipse
mvn eclipse:eclipse -DdownloadSources=true -DdownloadJavadocs=true
[edit] 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).
[edit] On Unix
./run_server.sh
Open a new terminal, change to the skycastle directory, and type:
./run_client.sh
[edit] On Windows
run_server.bat
Open a new command prompt, change to the skycastle directory, and type:
run_client.bat
[edit] 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.
[edit] Troubleshooting
[edit] Classpath problems
Note: Remember to use : as classpath separator on Linux, instead of ;
[edit] 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.
[edit] Interactive help
Drop in to IRC and ask us if you run into other problems.

