Please note that the Computer Science departmental site has been migrated to https://brocku.ca/mathematics-science/computer-science and this copy is only being provided for historical reference. Information that you find on this site WILL BE OUT OF DATE. For more information please visit https://www.cosc.brocku.ca/migration.
You are here
Java Installation
Installation instructions for Java JDK, Dr. Java and Brock Libraries.
These instructions will help you configure your Java environment to be similar to that of the Brock Computer Science labs. Follow these steps in order to ensure a proper installation. This has been tested on Windows OS but should also work on Apple and Linux with the appropriate JDK installation.
Download and Install OpenJDK
Due to the licensing changes which Oracle applied to the Java JDK in 2019, most Java IDE projects such as Dr. Java have migrated to OpenJDK. Fortunately, Amazon has offered installers for OpenJDK 8 on multiple OS platforms with the Corretto project.
- Go to https://docs.aws.amazon.com/corretto/latest/corretto-8-ug/downloads-list.html
- Click to download JDK 8 for your OS (you should verify the MD5 sum of the download) (Be sure to download the Java 8 JDK, NOT the newer version which is currently 11)
- Once downloaded, follow the install instructions without changing any install parameters (especially install path)
- OpenJDK should now be installed
Download Dr. Java
- Review the information on the project main page at:http://drjava.org
- Go to http://sourceforge.net/projects/drjava/files/1.%20DrJava%20Stable%20Releases/
- If you have installed OpenJDK version 8.222 or newer you can use drjava-beta-20190813-220051.jar
- If you have an older version of Oracle JDK then you can use the drjava-beta-20160913-225446.jar release
- Windows Users - The older version with .exe files only seem to work on the older Oracle JDK insallations.
- Mac Users follow these steps:
- Double click on the downloaded JAR file
- A pop up box will appear saying that it's can't be opened because it is from an unidentified source. Click ok to disregard message
- Open up System Preferences by clicking Apple in top left hand corner and opening System Preferences
- Click on Security & Privacy icon
- Click the Open Anyway button (beside message saying that the JAR file was blocked from opening)
- Click the Open button
Look at the interactions pane when you open Dr. Java. There should be a line of text similar to 'Compiler ready: JDK 8.0_222 from C:\Program Files\Amazon\Corretto\jdk1.8.0_222\lib\tools.jar.' If you do not see this line (or something very similar), then the JDK has not been installed properly. It might also say something such as 'Eclipse Compiler ready' which is perfectly fine as well. Dr. Java is able to locate the JDK automatically, and so will not function if it cannot find it. Dr. Java is now ready to use!
Download and add Brock Packages (Media.jar and BasicIO.jar)
- Go to http://www.cosc.brocku.ca/files/downloads/java/Brock_Packages.zip which will link to the download of a ZIP file
- Once downloaded, extract the files by right-clicking the ZIP directory and selecting 'Extract All'. If you do not see this option (or another extraction method) you can download a utility such as 7-Zip
- Move the two JAR files to a known directory. A good suggestion is to place them in the same folder as Dr. Java on the C:/ drive, or a folder on their own on C:/ named 'Brock Packages'. Make sure you remember this path!
- Open Dr. Java (double-click JAR file)
- In the menu bar, click 'Edit', then 'Preferences...'
- You should automatically have the 'Resource Locations' tab open, but if not click to open it on the left
- Under 'Extra Classpath', click 'Add'
- Navigate to the path of BasicIO.jar and Media.jar and add them both
- Click 'Apply', then 'OK'
- The Brock packages should be ready to use! Make sure you do not move the Brock packages once you've added them, otherwise you'll need to go over these steps once more.
- Write a simple Java program using TurtleGraphics in order to test the installation