Installing Java at home
CS 27500-002 (MW)
Data Structures
Fall, 2021
To write Java programs you need some kind of Java development environment. This page describes how to install a small, educational Java development environment called DrJava.
Before you can install DrJava, you must install a JDK (a Java Development Kit). We will use the Amazon Corretto JDK. The steps below tell you how to install this programming environment along with DrJava. There are roughly two parts to this installation. The first part (Step 1) is installing the JDK and the second part (Steps 2-5) is installing and configuring DrJava.
Step 1:
Install JDK 8 (DrJava only works with the older Java 8 JDK). Use a link at the end of this paragraph to download Amazon's version of JDK 8 for either Windows or MacOS (its being downloaded from this page). Be sure to notice where on your computer the installer program is downloaded to. After you have downloaded the installer program to your computer, double click on the installer program to run it. Accept all of the default options that the installer program presents you with.
Windows:
https://corretto.aws/downloads/latest/amazon-corretto-8-x64-windows-jdk.msi
MacOS:
https://corretto.aws/downloads/latest/amazon-corretto-8-x64-macos-jdk.pkg
Step 2:
Use the link at the end of this paragraph to download a zip file containing a copy of the DrJava program. Save the zip file on your desktop.
cs27500.zip
Step 3:
The last step downloaded a zip file, cs27500.zip
. Right click on this zip file and choose "extract all" from the context menu. After unzipping this file, you will have a new folder called cs27500
on your desktop. Move this folder to your C:\
drive, so that you now have the folder C:\cs27500
.
Step 4:
In this step you will test your DrJava installation.
Open the folder C:\cs27500
. In the folder there is a program called drjava-beta-20190813-220051.jar
. This is the DrJava program. Double click on this file to run DrJava. This will open DrJava with an empty editing pane.
Test your Java and DrJava installation by dragging the file DrJavaExperiment.java
from the C:\cs27500
folder into DrJava's empty editing pane (this is called "drag and drop").
Click on DrJava's "Compile" button. You should see a "Compilation completed." message in the lower "Compiler Output" pane of the DrJava window and you should now find a new file, DrJavaExperiment.class
, in the C:\cs27500
folder. Click on DrJava's "Run" button. You should see a small window pop up on your computer screen.
The Java JDK and DrJava should be installed properly at this point.
Step 5:
It is a good idea for you to turn on "file name extensions" in Windows. Please follow these directions.
How to Make Windows Show File Extensions