Eclipse Setup

To complete the CS 125 machine problems (MPs) you’ll write Java code using the Eclipse Integrated Development Environment (IDE), augmented with several plugins. This guide will help you install and configure this important and powerful tool.

1. Eclipse

Eclipse is a powerful and popular open-source integrated development environment (IDE). Many programmers utilize IDEs to simplify the process of writing, building, testing, and debugging both large and small applications.

If you have a laptop or desktop that you plan to use for CS 125, you should install Eclipse on it. Follow the instructions below that are appropriate for your machine. Unfortunately Eclipse is not always the easiest piece of software to install, so don’t be discouraged if you get stuck. We’re here to help.

Note that you should always download the latest version of Eclipse. As of late August 2017 that is Eclipse Oxygen.

1.1. Windows

The easiest solution for Windows machines is to use the very nice Ninite bundled installed 1. It will allow you to install both the Java Software Development Kit (SDK) and the Eclipse Integrated Development Environment (IDE) at the same time.

Here are the steps to follow:

  1. Go to ninite.com.

  2. At minimum you need to check the "Eclipse" and the "JDK x64 8" boxes 2.

  3. Download and run the installer.

At this point you should be able to find Eclipse in your installed applications, or as a shortcut on your desktop.

If you’re nervous about using Ninite—despite their backing by Y Combinator and glowing reviews by PC World and others—perhaps this will assuage your fears. I actually went to school with Patrick Swieskowski, one of the Ninite co-founders. He’s both a great guy and a tremendous developer. I would trust him to install software on my machine 3.

1.2. Mac

On Mac there are two steps to installing Eclipse. First, you must install the Java Software Development Kit (SDK):

  1. Go to this website. Accept the license agreement and download the Java SE Development Kit for Mac OS X.

  2. Run the installer to complete the installation.

Next, install the latest version of Eclipse:

  1. Go to eclipse.org and click on the download link. Continue by clicking on the download link on the next page.

  2. Download and run the installer to complete the installation.

By default Eclipse installs itself into an eclipse folder in your home directory. If you want it in your applications, move the installed binary into your Applications folder.

1.3. Linux

The first step when running Linux is to install Oracle Java. You can follow these instructions on the Java homepage. Many distributions also have Sun Java packages as well—for example, Ubuntu and Mint users can follow these instructions to use the Web Upd8 PPA.

To get Eclipse, start by downloading the Eclipse Oxygen tarball from the Eclipse homepage. Unpack it and you should have a executable binary. The screencast above walks you through that process.

2. Eclipse Plugins

Once you have Eclipse installed, continue by installing several plugins. Plugins extend Eclipse by providing new features or capabilities. Remembers: computers are powerful and love performing repetitive tasks. So they are great at doing things like checking our code for formatting problems, running tests, and building large projects from multiple source code files.

Note that while these instructions are written for Eclipse Oxygen, they have also been tested on Eclipse Neon. While we strongly suggest that you use Oxygen, Neon is currently installed on the Engineering Workstations (EWS). Note that there is a small difference in the Neon instructions once you read the Gradle section.

2.1. Subversive Subversion Plugin

Subversion is a software version control system (VCS). It allows both individual developers and teams to work together more effectively. You will use Subversion to retrieve your machine problem (MP) assignments, and to submit your solutions.

To install the Subversive Subversion Eclipse plugin, follow the following instructions:

  1. Open the Eclipse Software Marketplace: "Help → Eclipse Marketplace".

  2. Search for "subversive".

  3. Install the latest version of the "Subversive - SVN Team Provider" plugin.

  4. Restart Eclipse if it doesn’t automatically.

2.2. Subversion Connectors

Now we need to install some additional software to allow Subversion to connect to our course repository. Continue by following these instructions to set up so-called Subversive connectors:

  1. Open the Eclipse software sources dialog: "Help → Install New Software".

  2. Work with http://community.polarion.com/projects/subversive/download/eclipse/6.0/update-site/ and click "Add".

  3. Name the repository anything you want— "Subversive Connectors" is fine.

  4. Select both the "Subversive SVN Connectors" and "Subversive SVN Connectors Sources" checkboxes.

  5. Complete the rest of the installation dialog. When it prompts you about installing untrusted sources, click install anyway.

  6. Eclipse should restart again, at which point you are all done.

2.3. checkstyle

When you write code, style matters. This is particularly important as you start to work with others. Inconsistent style produces code that is hard for others to read and understand.

As a result, almost all large 4 software projects produce style guidelines. These are rules about how code should be formatted to ensure consistency across multiple developers. Some languages, like Go, have even gone as far to make certain stylistic choices part of the code language specification.

To prepare you for the big wide communal world of programming, we’re going to have you install and use an Eclipse style checking plugin. checkstyle is a Java style checking tool that is used and supported by large companies that write Java—including Google 5. Our style guidelines are based on the Sun Code Conventions.

Installing the checkstyle plugin for Eclipse is fairly easy by using the software marketplace:

  1. Open the Eclipse Software Marketplace: "Help → Eclipse Marketplace".

  2. Search for "checkstyle".

  3. Install the latest version of the "CheckStyle" plugin.

  4. Restart Eclipse if it doesn’t automatically.

2.4. TestNG

Writing good tests are an important part of effective software development. Eclipse comes with built-in support for the JUnit testing framework, but we may want to experiment with another testing framework called TestNG. It has some nice features that JUnit lacks—even if it has a much uglier website.

The process is quite similar to the one for checkstyle:

  1. Open the Eclipse Software Marketplace: "Help → Eclipse Marketplace".

  2. Search for "testng".

  3. Install the latest version of the "TestNG for Eclipse" plugin.

  4. Restart Eclipse if it doesn’t automatically.

2.5. Gradle

Building large software projects consisting of multiple source code files is a complex process. To address this problem, developers frequently use so-called build systems to automate this process. Build systems can intelligently determine what steps need to be taken to build a complete application, automatically do things like check style (using tools like checkstyle) or run tests (using tools like TestNG). We’re also going to use Gradle to run the tests on your code that will produce your grade for each MP.

Gradle is a build system. It is frequently used for Java projects, but can be used to build a variety of different kinds of software projects.

The instructions that follow are slightly different for Oxygen and Neon, so make sure that you follow the ones appropriate to your version of Eclipse.

2.5.1. Oxygen

Gradle is actually so important that Eclipse Oxygen comes with it pre-installed. Unfortunately, the bundled version is out of date so we need to update it manually.

Here’s what to do:

  1. Open the Eclipse Software Marketplace: "Help → Eclipse Marketplace".

  2. Search for "buildship". It should say "Installed".

  3. Click on "Installed", then "Update".

  4. Accept the license agreement.

  5. Restart Eclipse if it doesn’t automatically.

2.5.2. Neon

Unlike Oxygen, Eclipse Neon does not come with Gradle installed. But it’s easy to install it. Here’s what to do:

  1. Open the Eclipse Software Marketplace: "Help → Eclipse Marketplace".

  2. Install the latest version of the "Buildship Gradle Integration 2.0" plugin.

  3. Restart Eclipse if it doesn’t automatically.

CS 125 is now CS 124

This site is no longer maintained, may contain incorrect information, and may not function properly.


Created 10/24/2021
Updated 10/24/2021
Commit a44ff35 // History // View
Built 10/24/2021 @ 21:29 EDT