NOTE: This page is for an old offering of the course. To find the latest course offering, please visit https://comp311.rice.edu/.

Adapted from Professor Wallach's Comp 215 instructions for installing IntelliJ IDEA with Java 8.


This document walks through all the necessary steps to install IntelliJ properly, including the necessary libraries and plugins to use is with Scala.

Installing Java 8

You need to install the latest version of the Java Development Kit (JDK). You can get it here

http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

You want the ``Java SE Development Kit 8u60'' for whatever your computer happens to be. Oracle supports you for Windows, Mac OS X, and Linux.

If you're using an ``old'' version of Java8 that you may have installed in prior months or years, this is a good time to update to the latest and greatest. Prof. Wallach started out writing code for Comp 215 with last year's ``8u25'' version and managed to get the Java compiler to blow up on his perfectly reasonable and beautiful code. (That said, something that worked great for Prof. Wallach with 8u51 totally failed in the latest 8u60. We'll work through these issues when they occur. Don't panic.)

Installing IntelliJ

Visit the IntellJ IDEA download site: https://www.jetbrains.com/idea/download/

and download the free ``community edition''. (There's nothing in the ``ultimate'' edition that will make any difference to your work in Comp215, Comp322, Comp311, or (hopefully) most other undergraduate computer science courses.)  Versions are available for Windows, Mac OS X, and Linux. IntelliJ is an example of an integrated development environment (IDE). The other popular Java IDE you may have heard of or used in the past is Eclipse.


If this is the first time you have installed IntelliJ IDEA on your computer, the software will ask you to customize it a bit before starting. You can pick a color scheme that you like, then it will ask you to customize different plugins. Go through these pages and follow these instructions:

Creating a Project

If you've got something old around, this is a menu entry, File → New → Project... Otherwise, if you're staring at the ``Welcome to IntelliJ IDEA'' tiny screen, there's a ``Create New Project'' button. Click it. Either way, you'll see many different kinds of projects to choose from. In the left column, near the bottom, it should offer you a ``Scala'' project as an option. Select that. It will give you sub-options for "Scala", "SBT", and "Activator". Click "Scala". Then click "Next".

Locating Scala SDK and the JDK

You will now need to tell IntelliJ where to find the Java 8 JDK as well as Scala.

For Project SDK, click "New" and locate the folder containing the JDK you recently downloaded. Its location will be platform-specific:

For Scala SDK, click "Create". If Scala 2.11.7 does not appear as an option,  click "Browse" and navigate to the Scala folder you recently downloaded.

Writing Code

You will now have a new project with no open files. To create your first Scala file:

Writing Tests

The easiest way to start using JUnit with your project in IntelliJ is to:

                 import junit.framework.TestCase
                 import junit.framework.Assert._


                 class YourTestClass(name: String) extends TestCase(name) {

                 }

Running Tests

Run your tests in IDEA as follows: