Contents [0/8] |
Video [1/8] |
Tools [2/8] |
Install Graphviz [3/8] |
Install code for this class [4/8] |
Install Java 21 [5/8] |
Install Eclipse [6/8] |
Start eclipse in the eclipse-workspace you downloaded before [7/8] |
Eclipse tips [8/8] |
(Click here for one slide per page)
Video [1/8] |
Here are videos walking through the installation steps on MacOS and Windows. You only need to watch one.
Watch the video even in you already have eclipse installed: skip to the part where I start eclipse and set up the workspace for the class.
Tools [2/8] |
Follow these steps, in order:
Remove any existing version of Java from your computer.
Start eclipse in the eclipse-workspace you downloaded before
Mostly, we take the defaults during installation. There is one important exception. You must uncheck the box to create a module-info file.
Install Graphviz [3/8] |
This step is necessary to draw the pictures, which is useful for debugging.
On windows, install Graphviz
from here:
Graphviz
Select the most recent 64-bit msi
.
On the mac, you need to install
Homebrew
After the install, brew will give you next steps. The important one is to add brew
to your path. One way to do this is to open a terminal and type (copy and paste, because you don't want any typos here):
echo "export PATH=/opt/homebrew/bin:\$PATH" >> ~/.zshrc
After that, restart the terminal (quit and open again). Then homebrew will be installed!
Once you have homebrew, just enter the following commands on the Terminal:
brew update brew install graphviz
Install code for this class [4/8] |
Quick links:
Step-by-step:Create a folder structure for course materials
For example, you might use:
C:\Users\myname\Documents\DataStructures
Download the zip file for the class: Code examples ZIP
Unzip the file into the folder for class.
This should create a folder called eclipse-workspace
.
The eclipse-workspace
folder should contain algs4
.
The algs4
folder should contain data
, src
, and maybe some other things.
Verify that the folder hierarchy looks like this:
C:\Users\myname\Documents\DataStructures\eclipse-workspace C:\Users\myname\Documents\DataStructures\eclipse-workspace\algs4 C:\Users\myname\Documents\DataStructures\eclipse-workspace\algs4\data C:\Users\myname\Documents\DataStructures\eclipse-workspace\algs4\src
On my machine, I have the following:
Install Java 21 [5/8] |
We will use Java 21. It is easiest to use eclipse if you remove any other versions of Java from your machine.
/Library/Java/JavaVirtualMachines/
You can download Java 21 from Amazon or adoptOpenJDK
JDK stands for Java Development Kit
.
Install Eclipse [6/8] |
Install the Eclipse IDE for Java Developers
from here:
Eclipse Downloads
Get the most recent version.
You should get Eclipse IDE for Java Developers
.
The main difference between versions is the number of
packages that come pre-installed. This is the
smallest version that has everything we need.
Start eclipse in the eclipse-workspace you downloaded before [7/8] |
Mostly, we take the defaults during installation. There is one important exception. You must uncheck the box to create a module-info file.
Make sure that you have downloaded the code for the class, as instructed before.
Verify that the folder hierarchy looks like this:
C:\Users\myname\Documents\DataStructures\eclipse-workspace C:\Users\myname\Documents\DataStructures\eclipse-workspace\algs4 C:\Users\myname\Documents\DataStructures\eclipse-workspace\algs4\data C:\Users\myname\Documents\DataStructures\eclipse-workspace\algs4\src
On my machine, I have the following:
Start eclipse. When it prompts you for a workspace, select your eclipse-workspace
folder.
C:\Users\myname\Documents\DataStructures\eclipse-workspace
DO NOT SELECT THE algs4
FOLDER!
In eclipse, navigate to
File > New > Java Project
In project name
type algs4
. and then click the finish
button
Eclipse tips [8/8] |
Source > Format Source > Correct Indentation Refactor > Rename... Project > Clean... Window > Perspective > Reset Perspective...
Here is some advice on getting bigger fonts for eclipse
Revised: 2024-02-19 11:00