Building Stendhal is very simple if you use ant and you satisfy the dependencies.
But first... are you sure that you don't want to use an IDE?
This guide is aimed at those who just want to play the latest version of the game before it is officially released. If you intend to do modifications to the game, it is recommended that you follow Configure a development environment (IDE) instead.
Get the source Stendhal code
First of all, you need to get the Stendhal source code. There are two ways:
- Download the source distribution at https://arianne-project.org/download/stendhal-src.tar.gz Use
tar xzf stendhal-version-src.tar.gzto unpack it.
- Alternatively you can clone the git repository to get the latest development version:
sudo apt-get install gitand
git clone https://github.com/arianne/stendhal.git.
These are the requirements needed to build Stendhal:
- OpenJDK or Oracle JDK 1.7 or higher e.g.:
sudo apt-get install openjdk-8-jdk
http://ant.apache.org or e.g.:
sudo apt-get install ant ant-optional:
Building with ant
cd stendhal-version ant clean && ant dist
This will create the binaries you should be already familiar with, such as:
Building just the jar files
Note: If you are unsure, follow the instructions described in the previous section (ant dist) to get a working system with all the files in the correct directory structure.
To only build the jar files, without putting them together inside a zip, you just write
This will build a full set of JAR files at stendhal-version/build/lib folder:
If you have the message error:
stendhal_source/build.xml:42: Could not create task or type of type: replaceregexp.
For linux users this is corrected by installing the "ant-apache-regexp" package. If you use debian or another debian dist (like Ubuntu) this is included in the "ant-optional" package.
When you have successfully built Stendhal please read the install documentation. It is available on the Wiki at InstallingStendhal.
In the future if you wish to just create the client and server jars (not zips and all release packages) then
ant clean compile
will suffice. Remember to "ant clean" before you "ant build" everytime - this is done automatically if you "ant dist", however.