0.1. Environment Setup

Development kit, version control system, integrated development environment, and project management for Java programming.

Development Kit

Install the latest version of the Java SE Development Kit (JDK) on your local machine:

  • The required version: 17.x.x (or higher)

Although Java 17 is not the most recent version, it is the latest long-term support (LTS) release, which is preferred.

Version Control

Install Git using any of the following instructions:

Run the following commands on a terminal by replacing user.email and user.name with your email address and name:

git config --global user.email "your_id@emory.edu"
git config --global user.name "Your Name"

Integrated Development Environment

Install the latest version of IntelliJ IDEA on your local machine:

  • The recommended version: 2022.3.x (Ultimate Edition)

  • Apply for the academic license with your school email address to use the ultimate version.

Even if you already have an IDE that you are familiar with for Java programming, we strongly recommend you use IntelliJ because JetBrains provides IDEs for many popular programming languages with similar interfaces, which makes it easier for you to adapt.

Project Management

Launch IntelliJ and create a Gradle project by clicking the [New Project] button at the top:

  • Name: dsa-java

  • Location: local_path/dsa-java

  • Check "Create Git repository"

  • Language: Java

  • Build system: Gradle

  • JDK: 17

  • Gradle DSL: Groovy

  • Uncheck "Add sample code"

  • Advanced Settings:

    • GroupId: edu.emory.cs

    • ArtifactId: dsa-java

For JDK, you should be able to see version 17 if it is properly installed. If you cannot find the version, click [Add JDK] and select the following directory.

  • Windows: C:\Program Files\Java\jdk-17.x.x

  • Mac: /Library/Java/JavaVirtualMachines/jdk-17.x.x.jdk

Open gradle/wrapper/gradle-wrapper.properties and make sure distributionUrl indicates the latest version of Gradle:

distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip

Click [Settings - Build, Execution, Deployment] on the menu:

  • Click [Build Tools - Gradle] and set Gradle JVM to 17.

  • Click [Compiler - Java Compiler] and set Project bytecode version to 17.

Click [File - Project Structure] and select [Project Settings]:

  • Click [Project Settings - Project] and set SDK to 17 and Project language level to SDK default.

  • Click [Project Settings - Modules - Dependencies] and set Module SDK to 17.

  • Go to [Platform Settings - SDKs] and select 17.

Open build.gradle and make sure sourceCompatibility and targetCompatibility are set to java version 17 (add the following configurations if they do not exist already):

compileJava {
    sourceCompatibility = JavaVersion.VERSION_17
    targetCompatibility = JavaVersion.VERSION_17
}

Lastly, check mavenCentral() is configured as a repository in your build.gradle:

repositories {
    mavenCentral()
}

There is another popular build tool called Maven. However, we will use Gradle for this course because it is faster and simpler to build a Java-based project.

GitHub Integration

To integrate the project with your GitHub repository, click [Settings]:

  • Choose [Version Control - Github] on the left pane.

  • Click [+] and login with your GitHub ID and password.

  • If you use two-factor authentication, log in with your personal access token.

Create .gitignore under the project and add the following contents:

/.gradle/
/.idea/
/.vscode/
/build/

Click [Git - GitHub - Share Project on Github] and create a repository:

  • Make sure to check private.

  • Repository name: dsa-java

  • Remote: origin

  • Description: Data Structures and Algorithms in Java

Add all files and make the initial commit. Check if the repository is created under your GitHub account: https://github.com/your_id/dsa-java.

We recommend you create a GitHub account with your school email address, allowing you to add unlimited collaborators to the repository.

Last updated

©2023 Emory University - All rights reserved