Eclipse Tutorial

Installing Java 8 and Eclipse (Oxygen)

Please read this section in its entirety before installing Eclipse. Notice that these instructions are for Java 8 and Eclipse (Oxygen). Before installing any software, double-check with your instructor whether this is the software you need, otherwise you will not be able to work on your projects.

Although you can use Eclipse in the campus workstation lab, we highly recommend that you install the Eclipse environment on your own computer. The Eclipse installation process has two steps:

  1. Install Java SE Development Kit 8 (jdk-8u144 as of Aug 2017). Notice that the links below provide access to jdk-8u144, but most recent versions could be available. See the downloads site below if you would like to access the latest Java release. Keep in mind that in many systems (e.g., Windows) the Java updater can take care of updating your Java version.
  2. Install Eclipse (Oxygen).

Below we describe the installation process for Windows and for Mac OS X . If you have a different system (e.g., Linux) see Software Sources below. Feel free to skip the section that does not apply to your system.

IMPORTANT: For cmsc131 and cmsc132 we recommend you do not use the Eclipse installer and instead follow the instructions we have provided below. Notice that to use Eclipse in our courses you need to install the Course Management Plugin (allows you to submit projects) and for recent Eclipse releases you also need to add a CVS plugin (earlier versions had default CVS functionality).

Windows

  1. Install Java 8

    Note: If you have previous versions of Java already installed, you might want to uninstall them. Having multiple versions of Java has caused problems in the past. If your Eclipse environment is not working or it stops working, one possible reason is a conflict between different Java versions.

    1. For 64-bit machines download jdk-8u144-windows-x64.exe (Windows x64(64-bit)).
      For 32-bit machines download jdk-8u144-windows-i586.exe (Windows x86(32-bit)).
    2. Double-click on the downloaded file and follow the installation instructions. You do not need to register the JDK.

  2. Install Eclipse (Oxygen)

    1. For 64-bit machines download EclipseOxygen64WCSPlugin.zip.
      For 32-bit machines download EclipseOxygen32WCSPlugin.zip.

      Note: Use 7-zip to unzip files.

    2. Once you have unzipped the file you will find the Eclipse application (a big blue dot) in the unzipped folder. We recommend that you create a shortcut for it on the desktop in order to simplify the launching of Eclipse. Once you have unzipped the file you are done.

    3. Notice that the .zip files provided above already include the CS and CVS plugins used for project submission.
    4. If you have an Eclipse workspace that was using a different Java version you may experience some problems; just create a new workspace.

If you need to uninstall/remove Eclipse, just delete the folder associated with Eclipse. There is no uninstall option (e.g., in Control Panel) that you need to access.

Mac OS X

  1. Install Java 8

    To install Java 8.0 you need to have Mac Lion or above. You can find the operating system version on a Mac by opening "About this Mac" from the system menu. You can verify the Java version you have by opening a command window and executing java -version.
    1. Download the file jdk-8u144-macosx-x64.dmg.

    2. Double-click on the downloaded file and follow the installation instructions. You do not need to register the JDK.

    3. Note: If you already have Eclipse installed, create a new Eclipse workspace so the latest Java release is recognized.

  2. Install Eclipse (Oxygen)

    Most Macs are Intel 64-bit machines therefore the software you need is eclipse-java-oxygen-R-macosx-cocoa-x86_64.dmg. Once you have unzipped the file you will see the Eclipse application (a big blue dot). Move the application to your desktop. Notice that the zip file DOES NOT include the CS nor the CVS plugin used for project submissions. You need to install them using the instructions provided below (CS and CVS Plugins). If you have a Mac that is not an Intel 64-bit machine, download the appropriate eclipse version from http://www.eclipse.org/downloads.


    For those using Mac OS X Mountain Lion (10.8): When you launch Eclipse for the first time, you may see the message "Eclipse can't be opened because it is from an unidentified developer." To launch Eclipse for the first time, press the control key, click on the Eclipse icon, and select Open.

If you need to uninstall/remove Eclipse, just delete the program associated with Eclipse. There is no uninstall option that you need to access.

CVS and CS Course Management Plugins

  1. Install the CVS Plugin

    • In Eclipse, select Help→Install New Software...
    • In the "Work with:" drop-down menu, select the "--All Available Sites--" option.
    • From the list check "Eclipse CVS Client"
    • Select Next twice, accept the license, and click Finish.
  2. Install the Course Management Plugin

    • In Eclipse, select Help→Install New Software...
    • Click on the "Add..." button.
    • In the dialog box:
      • For "Name" use: Maryland Eclipse Update Site
      • For "Location" use: http://www.cs.umd.edu/~pugh/eclipse
    • Click on the "OK" button.
    • In a PC click the > next to "Uncategorized" and select the Course Project Manager. In a Mac, first uncheck the entry labeled "Group items by category" then select (check) "Course Project Manager".
    • Select Next twice, accept the license, and click Finish.
    • Select "Install anyway" in the popup window that warns about installing software that contains unsigned content.

USB drive (PC)

You can install Eclipse and Java on a USB drive, and run Eclipse from a PC with a USB port. Keep in mind that it can be slow to access Eclipse following this approach. You need around 1GB just for Eclipse and Java, therefore a USB drive of at least 2GB is recommended.

  1. Copy the the Eclipse Distribution (e.g., EclipseOxygen64WCSPlugin.zip) to the USB drive, and unzip it (remember to use 7-zip to unzip).
  2. Copy the Java JDK from your PC to the USB drive. You will find the JDK under C:\Program Files\Java. Usually it is named jdk1.8.0_###, where ### is a three-digit value (e.g., C:\Program Files\Java\jdk1.8.0_144).
  3. Define the workspace on the USB drive as follows:

    1. Launch Eclipse (look for eclipse.exe in the Eclipse folder).
    2. In the “Select a directory as workspace” dialog, use the “Browse...” option to select the USB drive (e.g.,E:). After selecting the drive click on the OK button.
    3. Provide a folder name after "Workspace: ". For example, USBWorkspace.
    4. Click on the OK button.
  4. Define the JRE present on the USB drive as the one to use for projects as follows:

    To define the JRE in Eclipse, select Window → Preferences → Java → Installed JREs → Search and locate the JDK folder (e.g., jdk1.8.0_144) you placed in the USB drive. Select the folder and click on the OK button. This will search for the jre. Make the jre the default by selecting the jre from the list displayed (look for Name, Location, etc.). Make the jre the default one and click on the OK button. Notice that while creating a project you might need to specify the particular JRE to use. Just right-click on the "JRE System Library", select Properties → Alternate JRE: → Installed JREs, and the appropriate JRE.

USB drive (Mac)

You can install Eclipse and Java on a USB drive, and run Eclipse from a Mac with a USB port. Keep in mind that it can be slow to access Eclipse following this approach. You need around 1GB just for Eclipse and Java, therefore a USB drive of at least 2GB is recommended.

  1. Copy the Eclipse application to the USB drive.
  2. Copy the Java JDK from your Mac to the USB drive. You will find the JDK under /Library/Java/JavaVirtualMachines/. The folder you need to copy is the Home folder you will find in the Contents folder of the specific JDK. Here is an example:

    /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home

    To locate the above folder, you might need to update the Finder preferences so you can find the above folder. Under Finder preferences select (check) all entries under "Devices." After opening a Finder window, you should find the Library folder mentioned above by clicking on Macintosh HD.
  3. Define the JRE present on the USB drive as the one to use for projects as follows:

    1. Launch Eclipse.
    2. In the “Select a directory as workspace” dialog, use the “Browse...” option to select the USB drive.
    3. Provide a folder name and click on OK button.
  4. Bring up Eclipse and define the JRE present on the drive as the one to use for projects as follows:

    In Eclipse, select Eclipse → Preferences → Java → Installed JREs → Add... → MacOS X VM → Directory..., and select the HOME folder associated with the JDK. Make sure you select this JDK as the default in the "Installed JREs" section ( where you see "Name, Location"). To select it as default, check the box next to the JRE and click on the OK button. Notice that while creating a project you might need to specify the particular JRE to use. Just right-click on the "JRE System Library", select Properties → Alternate JRE: → Installed JREs, and the appropriate JRE.

Linux

  1. Notice that the default version of Java that comes with Linux will NOT work with Eclipse. Additional information at Eclipse Does Not Start.
  2. Install Eclipse from the main Eclipse site (see Software Sources below).
  3. Install the necessary plugins (see CVS and CS Course Management Plugins).

Some linux distributions (e.g., Ubuntu) have a package for Eclipse available via their software installation tool, but unless it's the version specified above, it is preferable to install it directly from the Eclipse site.

If you need to uninstall/remove Eclipse, just delete the directory associated with Eclipse. There is no uninstall option.

Color themes

Note: You don’t need to install this plugin. It is just for fun, or in case you want to change the default color scheme.

  1. From the menu, select Help → Install New Software...
  2. Click on the "Add..." button.
  3. In the dialog box:
    • For "Name" use: Eclipse Color Theme Update Site
    • For "Location" use: http://eclipse-color-theme.github.com/update/
  4. Click on the "OK" button.
  5. Select "Eclipse Color Theme".
  6. Select Next.
  7. Select "Eclipse Color Theme".
  8. Accept Terms and select Finish.
  9. Restart Eclipse.
  10. Windows / Mac
    • Windows - Go to Window → Preferences → General → Appearance → Color Theme and make your desired changes.
    • Mac - Go to Eclipse → Preferences → General

Software sources