1. Getting started
The focus of this tutorial is to show how to build MOA from the source code available in the GitHub repository. It is specially useful for people intending to extend MOA (e.g., researchers or developers), if you just want to use MOA, then the first tutorial on this series (available here: \firsttutorial) is more appropriate.
There are multiple ways of building the MOA code, however, we are going to focus on using one of the easiest, so that you can (hopefully) get started with coding in MOA in less than 5 minutes.
- During the development of this tutorial the latest version of MOA was 2019.04 (available here: here, but it is not really necessary for this tutorial). However any future release in the GitHub repository should work.
- We assume you are already familiar with what is MOA and the MOA GUI. If that is not the case, you probably should check this tutorial first
- You may want to fork the repository before cloning it, so that you have your own ‘copy’ of the repository.
- We are going to use Intellij IDEA Community version. Download and install it from here.
- You will need a Java JDK 8 or later. You can download Java JDK 8 from here. Tip: Check what java version you have installed with the command ‘java -version‘ in a terminal.
- It is easier to obtain the source code if you use Git. Download and install it from here. Optionally, you can ‘git clone‘ the repository and ‘import‘ the project in Intellij IDEA, there are other options like downloading a zip with all the code, but importing it directly is easier.
2. Building the code
Open Intellij IDEA and click on “Check out from Version Control” as shown below.
There are two other options to check out the project from GitHub.
Via “File > New > Project from Version Control… > Git” as shown below.
Or via “VCS > Checkout from Version Control > Git” as shown below.
Copy the link to the repository as shown below.
The link to the repository: https://github.com/Waikato/moa
Paste and test the URL in the “Clone Repository” window as shown below.
You should obtain a message as shown below. Click on “Yes” to open the project.
Add a new configuration by clicking on “Add configuration” as shown below.
Add a new “Application” configuration by clicking on (1) and then (2) as shown below.
Setup the run configuration as described below and illustrated in the Figure:
(1) Give it a meaningful name (e.g., “GUI” or “run GUI“);
(2) Select the class “moa.gui.GUI“;
(3) Select the module “moa“;
(4) Check if the default JRE is correct*.
- If you run into trouble configuring the Java JDK in Intellij, you are not the first one, so refer to this tutorial.
Run or debug the MOA GUI by clicking on Run or Debug as shown below.