-
Notifications
You must be signed in to change notification settings - Fork 1
Allegro for new Java developers
This page will eventually be a full tutorial on how to start working with Allegro and Java given some basic programming knowledge. For now it is just some links to get started.
Jalleg includes a pre-built Allegro for Windows 64-bit Java.
- Download the jalleg repository. You can clone with git or download a zip from https://github.com/gillius/jalleg, just click the "clone or download button"
- Download and install Java 64-bit JDK from http://www.oracle.com/technetwork/java/javase/downloads/index.html. Get the latest version, Java 8 update 92 at the time of writing. On Linux machines you can work with OpenJDK 8 available from standard repositories.
- At this point, you should be able to open a command window and run
java -version
andjavac -version
and see Java installed. - Enter the jalleg directory, and you can now run gradlew script if your machine is connected to the Internet. Gradle will download itself and required dependencies such as JNA. Total download will probably be a few 10s of MB the first time you ever run Gradle (downloads will be cached and not repeat on later runs). Run the example via
gradlew run
. You should see the example start up.
The directions below are for Ubuntu systems. The commands are to be run from the terminal (ctrl-alt-T). Tested on Ubuntu 16.04 (xenial), but should work on earlier versions.
- Allegro installation instructions from the Allegro wiki:
sudo add-apt-repository ppa:allegro/5.2
sudo apt-get update
sudo apt-get install liballegro5-dev
- Installation of Java:
sudo apt-get install openjdk-8-jdk
- If you do not already have git, run
sudo apt-get install git
- Set up a development directory,
mkdir -p ~/dev; cd ~/dev
- Check out jalleg:
git clone https://github.com/gillius/jalleg.git
cd jalleg
./gradlew run
- Install Allegro from pre-built binaries or source using instructions from the Allegro Getting Started wiki.
- Ensure that Java JDK 7 or higher is installed
- Download the jalleg repository. You can clone with git or download a zip from https://github.com/gillius/jalleg, just click the "clone or download button"
- In the jalleg folder, run
./gradlew run
Jalleg has not been tested in OSX yet. However, it probably works this way:
- Install Allegro via homebrew
- Ensure that Java JDK 7 or higher is installed
- Download the jalleg repository. You can clone with git or download a zip from https://github.com/gillius/jalleg, just click the "clone or download button"
- In the jalleg folder, run
./gradlew run
I use and suggest the very excellent and free IntelliJ community edition. All of the features you might need for jalleg development are available in the free community edition. It can be downloaded here: https://www.jetbrains.com/idea/. For Windows it comes with a traditional installer. For Linux it comes as a tgz which you unpack and run the bin/idea.sh
within. The first time on Linux when you run idea.sh
it will ask if you wish to add a launcher shortcut.
After installing and running the IDE, simple open the "gradle.build" in the top level jalleg directory as a project. Everything will be set up for you and everything you need will be downloaded for you via Gradle if not already downloaded when running example earlier.
In the IDE's project tab on the left, navigate to the directory jalleg-examples/src/main/java/org/gillius/jalleg/example folder and in there you will see the examples. You can double click on a file to open and edit it. You can right click on a file and pick run to actually run it. IntelliJ will compile and run the example for you automatically. If you make code changes, just pick "run" again and IntelliJ will compile any changes then run.