You need to install the development tools on a personal computer, both to build the sample code, and work on your assignments (for various reasons, you cannot use lab computers for this course). This section explains what software to install and how to build and run the code samples.

Table of Contents

  1. Tools Installation & Configuration
  2. Building and Executing Code (from Existing Projects)
  3. Creating a New Project>

1. Tools Installation & Configuration

You need to setup the command-line tools first, and then install IntelliJ.

1.1. Command-Line Tools Setup

This video walks through installing Git, Gradle, and Java and opening and building sample code from the command-line.
Getting started with Java.

You can also just install the tools following the instructions on this page. You will need to install the following:

  1. Git Client 2.24. You will need this to get code samples and submit assignments.
  2. OpenJDK 11.0.8. The Java SDK that we will use.
  3. Gradle 6.6. This will be used to build your projects.

I suggest installing in this order, and making sure that the programs are in your path so that they can be executed directly. You should also check and make sure that the versions are correct. For example:

$ git --version
git version 2.24.3 (Apple Git-128)

$ java -version
openjdk version "11.0.8" 2020-07-14
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.8+10)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.8+10, mixed mode)

$ gradle -version

Gradle 6.6.1

Build time:   2020-08-25 16:29:12 UTC
Revision:     f2d1fb54a951d8b11d25748e4711bec8d128d7e3

Kotlin:       1.3.72
Groovy:       2.5.12
Ant:          Apache Ant(TM) version 1.10.8 compiled on May 10 2020
JVM:          11.0.8 (AdoptOpenJDK 11.0.8+10)
OS:           Mac OS X 10.15.6 x86_64

1.2. IntelliJ Setup

IntelliJ is a powerful Open Source Java IDE. It's optional for the first few assignments, but required for Android development later. It supports a number of very helpful features (e.g. code completion, API documentation tooltips, debugging, profiling) and is highly recommended.

This video describes setting it up: Getting started with IntelliJ.

IntellIJ with its default configuration should work fine. Make sure you have the following plugins installed (under File -> Preferences -> Plugins).

2. Building and Executing Code (from Existing Projects)

Once your tools are installed, you should check that you can run sample code that's provided.

Code samples shown during lectures, and referenced in the slides, are located in
You are allowed to use code from these samples in your assignments.

2.1. Building from the Command-Line

Gradle projects can be built and executed directly from the command-line:

  $ git clone samples

  $ cd samples

  $ cd 01.Intro/01.hello_world

  $ gradle build
  Starting a Gradle Daemon (subsequent builds will be faster)
  5 actionable tasks: 5 up-to-date

  $ gradle run
  > Task :run
  Hello world!
  3 actionable tasks: 2 executed, 1 up-to-date

Building from IntelliJ

Projects can also be opened in IntelliJ:

3. Creating a New Project

For your assignments, you will want to start with an empty project.

3.1. Templates

The public repository contains two starter projects that you can use. Both of these are empty projects that are buildable from the command-line or within IntelliJ. You can copy and modify these if you wish.

3.2. Creating a New Project in IntelliJ

The following steps will setup a Gradle project that works from both the command-line and from within IntelliJ.

  1. In IntelliJ, File -> New Project. Select Gradle/Java as the type of project.
  2. Provide a name and location, and click OK. This will create a project.
  3. From the Project panel on the left (Cmd-1 to toggle it), you will see a list of files. Open build.gradle.
  4. Change the contents of the build.gradle file to this:
      plugins {
          id 'java'
          id 'application'
          id 'org.openjfx.javafxplugin' version '0.0.8'
      group 'org.example'
      version '1.0-SNAPSHOT'
      repositories {
      dependencies {
          testCompile group: 'junit', name: 'junit', version: '4.12'
      application {
          mainClassName = 'Main'
      javafx {
          version = "11.0.2"
          modules = ['javafx.controls', 'javafx.fxml', '', '']
  5. Create a source file in the src/main/java folder (in this example, containing class Main).
  6. From the Gradle menu (View -> Tools -> Gradle), you should be able to "Build" and "Run" your application.
  7. Make sure that any new files that you add or create are placed in the appropriate subdirectory (src/main/java for source code, and src/main/resources for images or other assets).