Background
The version of BlueJ (4.1.1-duke
) that is recommended for use with the Java prereqs starting in Course 2 may have some stability issues on some versions of macOS. If it crashes frequently/regularly for you, you can try the following workaround.
NOTE: This is only applicable for Mac users working in Courses 2-4. If you are using Windows or Linux these instructions are not applicable (or necessary).
Downloads
- Download the latest version of BlueJ directly from their site: https://www.bluej.org/index.html. As of this writing this is version
5.0.3
, but you should choose the latest version available. - Download the 2 “Course Code Packages” from the Duke site:
TIP: Your Downloads folder should contain at least these 3 files after this (you may have a lot of other files in there too, as long as you see these 3 you’re good).
Configuration
- Extract the BlueJ zip file and run the BlueJ app by double clicking on the file (e.g.
BlueJ-mac-503.zip
). You should see a directory titledBlueJ 5.0.3
with an app calledBlueJ
inside of it - run that app.- NOTE: The first time you run the app you may see an alert asking you if you are sure you want to open it; as long as that message says that no malicious software was detected you can safely click the “Open” button.
- Click on the BlueJ menu at the top of your screen and click “Preferences”.
- Alternatively press
⌘,
to open the same window.
- Alternatively press
- Click the “Libraries” tab in the BlueJ Preferences window.
-
Click the “Add File” button on the top right of the window under the “User Libraries from config” heading, and choose the
courserajava.jar
from where you downloaded it, and click the “Open” button. You should now see this file listed in the table on the left side of the window. Repeat this process to add the fileapache-csv.jar
.Click to see what the preferences window should look like ...
- After you have loaded both files click the “OK” button, and then click it again to acknowledge the BlueJ Message that appears.
- Exit BlueJ completely.
- Launch BlueJ again, and you should be able to continue working through the exercises.
NOTE: BlueJ should remember these preferences between restarts of the app. You can verify that those 2 files are still loaded at anytime by going back into the BlueJ preferences and making sure they are still listed in the table. If you get a compilation error that says things like “package edu.duke does not exist”, double check that the 2 files are present, and if they are not simply re-add them as described above.
Verification
After following these steps you should have an installation of BlueJ with the Duke libraries loaded. You can verify that it is working as expected by following these steps.
- Download the hello.zip project from the Duke project site.
- If you have other Duke projects previously downloaded you can use any of them instead.
- Extract the downloaded zipfile and open it from BlueJ by clicking “Project” -> “Open Project”, and selecting the
hello
directory. The project should successfully compile when you click the “Compile” button.