Old version
This is the CS 112 site as it appeared on May 11, 2018.
Installation instructions for MacOS
Installing the JDK
- Go to the download page for Java SE Development Kit 8 on the Oracle website. (Important: You need version 8. Version 9 will not work.)
- Find the first table of download links (the one for Java SE Development Kit 8u161).
- Click on the radio button next to Accept License Agreement.
- Find the line for macOS and click on the name of
the file to the right of the red arrow on that line. (The file name
should end with
.dmg
). - If you receive an error message that says you are downloading from an unsafe or unknown site, you’ll need to change your security preferences, at least temporarily, by taking the steps outlined in the Lowering your security settings section below.
- Click the
.dmg
file to mount the Java installation disk image. - If the mounted image doesn’t show up in a Finder window, open a
new Finder window and select the disk image from the sidebar.
Once open, double-click on the
.mpkg
file to start the installer. - You should be able to use all of the default settings that the
installer gives you. Wait for the installer to finish and then
close it. You can now unmount the disk image by clicking the eject
icon in the sidebar or dragging it to the Trash. Then you can
delete the
.dmg
file by dragging it to the Trash.
Installing DrJava
- Go to the DrJava website.
- Click on the button labeled Download Jar File and download the file. Important: You must download the Jar file version. Do not choose any other version.
- If you receive an error message that says you are downloading from an unsafe or unknown site, you’ll need to change your security preferences, at least temporarily, by taking the steps outlined in the Lowering your security settings section below.
- Drag the
.jar
file to your Applications folder for permanent storage. - Click on the DrJava icon to start the program. If you see a message indicating that DrJava is damaged, that indicates that you need to change your security preferences, at least temporarily, by taking the steps outlined in the Lowering your security settings section below.
- Once it starts up, look in the lower right-hand corner of the
DrJava window. Under the Compiler heading, you should see some
version of the JDK listed. If you see None, you may need to
search for a file named
tools.jar
on your computer and specify its location manually by using the Edit → Preferences menu in DrJava. See the following page for more information: http://drjava.org/faq.shtml#no-compiler - Select the Preferences option from the Edit menu in DrJava and
do the following:
- Click on Display Options in the Categories pane and make sure that the checkbox for Show All Line Numbers is checked.
- Click on Miscellaneous option in the Categories pane and change the Indent Level setting to 4.
- If the default fonts are too small, click on Fonts in the Categories pane and change the fonts so that the sizes are larger. Important: For the Main Font, you should use a fixed-width font in which each character has the same width. Options include Monaco and Courier New.
- Click Apply, then click OK.
- Optional: If you needed to change your security settings, you may return to System Preferences and restore the radio button to “Mac App Store and identified developers”. Once DrJava has been successfully started, it should continue to start without error, even with the original security settings.
Lowering security settings
MacOS may stop you from downloading or running applications downloaded from the Web (as opposed to through the Mac App Store) unless you lower your security settings. Here’s how to adjust them so that you may install and run applications from anywhere:
- Open System Preferences, located under the Apple menu in the top left corner.
- In the Security & Privacy preference pane, click the lock icon and authenticate as an administrator user.
- Make sure the radio button under Allow applications downloaded from: is set to Anywhere.
- Re-download or re-open the desired application.