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 Kitarrow-up-right (JDK) on your local machine:

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

circle-info

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 IDEAarrow-up-right on your local machine:

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

  • Apply for the academic licensearrow-up-right with your school email address to use the ultimate version.

circle-info

Even if you already have an IDE that you are familiar with for Java programming, we strongly recommend you use IntelliJ because JetBrainsarrow-up-right 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 Gradlearrow-up-right 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

circle-info

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.propertiesarrow-up-right and make sure distributionUrl indicates the latest version of Gradle:

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.gradlearrow-up-right and make sure sourceCompatibility and targetCompatibility are set to java version 17 (add the following configurations if they do not exist already):

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

circle-info

There is another popular build tool called Mavenarrow-up-right. 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 GitHubarrow-up-right 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 tokenarrow-up-right.

Create .gitignorearrow-up-right under the project and add the following contents:

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.

circle-info

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

Last updated

Was this helpful?