Please note: this article refers to the 2019-20 version of this course. It will be retired on September 1, 2020.
Before we jump in, you need to install two items in order to write and run Java code.
- Java Development Kit: The JDK has the tools and programming your computer needs to compile, debug and run Java programs.
- DrJava: DrJava is the application you will use to write and run your code. It's a great Integrated Development Environment (IDE) for beginner programmers. There are other IDEs that you can use, including Eclipse and BlueJ; however, videos in this course will feature DrJava and the instructions in the course are written to use DrJava.
If you are using Chromebooks or your students are otherwise unable to install these items and need a web-based solution, click here.
Installing the Java Development Kit (JDK)
1. Navigate to the download page for JDK 8 and scroll to the section titled "Java SE Development Kit 8u211"
- Although the DrJava documentation says to download the latest version, it is confirmed that 8 is the newest version that will work with DrJava.
- The Oracle Java SE Licensing FAQ confirms that the JDK software is free for use with an IDE and for homework as shown in the questions circled below.
2. First, make sure you have the "Accept License Agreement" button selected as shown below
3. To download the installation file, click on the link next to the listing for your operating system
4. Follow the instructions to create a free Oracle account
5. After creating your account, save the file in a location of your choosing when prompted
6. Run the downloaded file from that location. You may need to give the file administrator access or enter your user password.
7. Follow the installation wizard as directed
8. After installation is complete, you can delete the installation file that was saved in step #5
Installing DrJava for Windows
1. Navigate to the DrJava home page
2. Under the "Current Stable Release" section, click “Download Windows App”
3. Save the file in a location of your choosing when prompted
4. Run the downloaded file from that location. You may need to give the file administrator access or enter your user password.
5. Follow the installation wizard as directed
6. After installation is complete, you can delete the installation file that was saved in step #4
7. Test your installation by following the steps at the bottom of this page in the "Checking Your Installation" section
Installing DrJava for Mac
Before You Start
For an Apple machine, you will be downloading the
*.jar file, not the Mac app version. The Mac app link has been removed from the DrJava homepage, but not from the download page so be sure to not download it per the note on DrJava's homepage stating, "The Mac OS X app has been removed; it only worked for Apple Java, which ended with Java 6."
*.jar file is the standalone program itself so you will not see an installation wizard as there is no need to install anything - the program will run directly from the
*.jar file. Therefore, to run DrJava, just double-click the
1. To allow the
*.jar file you will be downloading to run, first open System Preferences
2. Click “Security & Privacy"
3. Select the "App Store and identified developers" radio button under "Allow apps downloaded from:"
4. If you are unable to click the item, check the lock in the bottom left-hand corner. It needs to be unlocked to make any changes.
5. Now, navigate to the DrJava home page
6. Under the "Current Stable Release" section, click “Download Jar File”
7. Save the file in a location of your choosing when prompted. We recommend saving it to your desktop so you can easily run the program from the desktop.
8. The first time you open the file, you will need to press the "control" key and click on the
*.jar file to display the menu and select "Open" since it is from a non-Apple developer.
9. Since you adjusted your security settings in step #3, you will get the dialog box below. Click "Open" to open DrJava. You will only need to do this the first time you open it and will be able to open DrJava by double-clicking on the file from now on.
7. Test your installation by following the steps below in the "Checking Your Installation" section
Checking Your Installation
Complete the following steps to confirm the JDK and DrJava were installed correctly.
1. Download this zip file: Java Test File
2. Unzip the folder
3. In DrJava, click the “Open” button from the menu along the top (see image below)
4. Select “Welcome.java” from the unzipped folder
5. From the menu, click "Compile" (see image below). The pane at the bottom of the DrJava window should say “Compilation completed”.
6. From the menu, click "Run" (see image below). The pane at the bottom should print a message welcoming you to the course.
If the file does not run properly, check out the Troubleshooting DrJava article for help.