Skip to main content

NOTE: You are free to use whatever development environment you want, but CIS 121’s supported IDE is IntelliJ.

Java & IntelliJ Setup

Instructions for Mac

Mac users can use a helpful tool called Homebrew to install both Java and IntelliJ.

First, open Terminal and install Homebrew if you have not yet:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Then, install Java and IntelliJ in this one command:

brew install --cask intellij-idea-ce adoptopenjdk/openjdk/adoptopenjdk8

Note: The above command installs IntelliJ Community Edition, which is free and open source. The Community Edition has all the needed features (and more) for CIS 121. That said, if you would like to install IntelliJ Ultimate, just replace intellij-idea-ce with intellij-idea. You can use Ultimate for free using their free 30-day trial; to continue using it, you can sign up for a free student license using this form.

Instructions for Windows

Step 1: Install Java 8

  1. To run IntelliJ, a Java Runtime Environment (JRE) must be installed. You can verify that you have the JDK 8 installed by running the java -version command (from the Command prompt in Windows or the terminal on Mac):

     $ java -version
     java version "1.8.0_101"
     Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
     Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)
    

    You should see output similar to lines 2-4 above. Any version of Java 8 will also work for this class. You should not use versions of Java higher than Java 8, or you may run into problems later on in the course.

  2. If you do not have the JDK 8 installed, you can download it from this site. Select the version for your OS from the table titled “Java SE Development Kit 8u311” (or whatever odd number it’s currently at). For example, the download file for 64-bit machines (which your machine is, most likely) will be titled jdk-8u311-windows-x64.exe. Note that you will need to accept the terms & conditions and may need to create a free Oracle account to complete the download.

    Note: It is best to do this step before installing IntelliJ.

Step 2: Install IntelliJ

We recommend using the latest version of IntelliJ. Make sure you have completed Step 1 before installing IntelliJ.

  1. Visit the IntelliJ installer page
  2. Click on the link for your platform on the right side of the screen (under “Download”) and unzip the downloaded file to extract the Installer. See the above note for differences between the Community and Ultimate editions.
  3. Run the IntelliJ Installer to install IntelliJ.
  4. Launch IntelliJ.

Importing and Creating a Java Project in IntelliJ

CIS 1210 provides you with stub files for each programming assignment. To import and create a project from these stub files:

  1. Download and unzip the stub files
  2. Launch IntelliJ → Open → Select the unzipped stub files
  3. Select Java Settings: File → Project Structure → Project → Set SDK to 1.8 and Language Level to 8 - Lambdas, type annotations, etc.
  4. If necessary, set the stub files as “Sources”: File -> Project Structure and then Modules -> Sources and mark the stub files folder as Sources.
  5. Add JUnit 4 (You MUST use JUnit 4): File → Project Structure → Libraries → + (should say “New Project Library” on hover) → From Maven → junit:junit:4.13.1

That’s it! Note that some homeworks may have more steps for setup; these steps are specified in the homework-specific writeups. Other than that, happy coding! :)