02: Installing the Eclipse IDE
Estimated reading time: 8 minutes
Estimated time to complete: 30 minutes (plus download time)
Prerequisites: Lab 01
In this course (and later ones, such as COMPSCI 187), you’ll be using an integrated development environment (IDE) to write, run, and debug the programs you write. We’re going to use Eclipse, a free and open-source IDE.
To help eliminate problems due to incompatible versions of Eclipse, we’ll all be using the same, latest, version of the Eclipse IDE: Eclipse Neon. This lab will walk you through installing Eclipse and verifying that it’s installed correctly on your computer.
Overview
In this lab, you’ll download and install the latest version of the Eclipse IDE for Java development. You’ll perform some minor configuration. Then you’ll verify it’s installed and working correctly by creating a small “Hello World” project. Finally, you’ll take a screenshot to submit as proof you completed the lab.
If you use a UMass IT Computer Classroom rather than your own computer, you may use the version of Eclipse installed there, which changes as IT updates the software in the computer classrooms. You will still need to perform the configuration and project creation steps detailed in this lab and submit the screenshot to receive credit. Launch Eclipse on the computer in the computer classroom, skip down to Launching Eclipse, and start by choosing a workspace.
Goals
- Install a working Eclipse IDE (or show you have access to one).
- Configure Eclipse to use the Java 8 environment.
- Create and execute a simple “Hello World” project.
- (optional but recommended) Set up and use cloud-based storage and/or regular backups of your COMPSCI 190D work.
Downloading Eclipse
Go to Eclipse’s web site (http://www.eclipse.org/), and press the shiny “Download” button:
Then click “Download” (may also say “64 bit” or “32 bit”) again:
Click “Download” once more to download the installer for Eclipse:
Depending upon your OS, this file may be an compressed archive (.tar.gz
or .zip
) or a directly executable installer (.exe
). If it’s an archive, open it to find the installer (Eclipse Installer
).
Installing Eclipse
Run the installer. You will be prompted to choose which “flavor” of Eclipse you want:
Marvel briefly at the many options available, but make sure you select the “Eclipse IDE for Java Developers”.
The default installation directory is fine (on my Mac, this is /Users/liberato/eclipse/java-neon
, that is, in eclipse/java-neon
inside my home directory), or you can place it in whatever directory you choose. In either case, make sure you note where it’s going so you can find it! The installer will download and install Eclipse, and this process can take a few minutes.
Launching Eclipse
If all goes well, you should see something like this:
Go ahead and click the “Launch” button. After a brief loading screen, you should see a window prompting you to choose a workspace:
A brief but important digression: The place you choose for the Eclipse workspace is where all of your work for this course will go. I strongly, strongly, strongly suggest you do one (or ideally both) of the following:
-
Sign up for a cloud-based storage service, sync that storage with your local computer, and place your Eclipse workspace in this synced directory.
As a member of the UMass community, you have access to Google Drive with basically unlimited storage space through Apps at UMass. Further, you can install the Drive application (https://www.google.com/drive/download/). When this is app is running, any changes you make to files in your local Google Drive directory will be uploaded to your Google Drive (and sent to any other of your devices that are also running the application). On my Mac, this directory is
/Users/liberato/Google Drive/
.Other cloud storage providers such as Box and Dropbox provide similar functionality.
-
Enable automatic backups to an external drive, or sign up for a backup service. Make sure your Eclipse workspace is being backed up.
OS X has Time Machine; Windows has Windows Backup, and there are myriad third-party backup utility vendors. Find one and use it. Make sure you know how to recover from a backup before you need it.
In any event, it’s 2017: storage and bandwidth are virtually free. “My drive crashed” won’t be acceptable as an excuse in this class, except as part of the sentence, “My drive crashed when my car crashed into the power substation supplying several of Google’s data centers during an unscheduled surge protector downtime, leading to an unanticipated power spike that destroyed the data centers, caused massive data loss, and made national news.”
Now back to our regularly scheduled lab.
Choose an appropriate directory to store your workspace and click OK. After a bit more loading, you’ll see the default Eclipse “Welcome” screen:
Eclipse has been installed.
Configuring Eclipse
Quit Eclipse using the appropriate menu item.
Now re-open it. (Do you remember where you installed it?) You should again arrive at the Welcome screen.
Open the Preferences
menu item. On a Mac, this will be located in the Eclipse
menu in the top-of-the-screen menubar; on Windows, it will be located under the Window
menu at the top of the Eclipse window. Either way, it should look something like the following:
Eclipse has about eleventy-hojillion configuration options, but we’re only going to look at one of them for this lab.
Expand the “Java” item on the left by clicking the small triangle next to it, then select “Installed JREs” by clicking on it (not the triangle, but the words “Installed JREs”). Here’s what it looks like on my Mac:
And here’s what it looks like on a student’s Windows 10 PC:
You should see a list of one or more JREs, depending upon what’s installed on your computer. If you don’t see “Java SE 8” (on a Mac) or “jdk1.8.0_121” (or similar on Windows and Linux – “jdk” and “1.8” are the important parts), click the Search...
button on the right, and it should show up (assuming you installed one earlier!). If it doesn’t, contact the TA or instructor via Piazza immediately for assistance, or check with a classmate for help. Make sure that “Java SE 8” or “jdk1.8.0_121” is selected (note the Windows screenshot doesn’t yet have the correct item selected!).
Creating “Hello World”
Eclipse comes with a tutorial creating “Hello World.” Run through it yourself by selecting it from the “Welcome” screen. If you accidentally close the welcome screen, you can re-open it by selecting the Welcome
menu item from the Help
menu.
When you reach the last step, instead of saying “Hello World!”, say hello to yourself. Run the program, and the Console
window at the bottom of the screen should show your program’s output:
Take a screenshot of Eclipse at this final step. For full credit your program must say hello to you, not to “World” or “Marc”.
Submitting the lab
Use the course Gradescope site to submit the screenshot you created.
If you choose to use the IT Computer Classrooms, submit a screenshot as above.