CS106A Eclipse Instructions

In CS106A, we'll be using Stanford's customized version of Eclipse to build our programs. Eclipse is an enormously popular industrial strength Java environment with many features. Fortunately, Eclipse is also open source -- anyone is free to change Eclipse to work the way they want. We have taken advantage of that freedom to install special Stanford features into Eclipse, tailoring it specifically for CS106A. This document gives instructions on how to get started using Stanford Eclipse. Please pay close attention to these instructions and do not skip steps!

NOTE: if you run into any issues while installing or using Eclipse, please see the bottom of this page for troubleshooting steps.

Installing Eclipse on a Mac

Stanford Eclipse will only work on macOS 10.6 (2009) or higher. If you don't have a supported version of the operating system, you'll need to either upgrade or do your class work on a cluster machine. You can check your version of macOS by clicking the "Apple" menu in the upper left-hand corner of the screen and selecting About This Mac.

  1. Download and install the Java SDK for Mac
  2. Download and install Eclipse for Mac. Drag the Eclipse app into the Applications folder on your Mac when a window appears with Eclipse and your Applications folder.
  3. Drag the Eclipse icon from your Applications folder to your Dock to create a shortcut.
  4. Click on the icon in the dock to open Eclipse. If you see an error that says Eclipse "can't be opened because it is from an unidentified developer," right-click on the Eclipse icon and select "open" instead. You will be able to open Eclipse without right-clicking from now on.
  5. Now you'll need to install the 106A-specific customizations. Skip to the section "Installing the CS106A Plugin" further down the page for more information.

Installing Eclipse in Windows

Our version of Eclipse will only work on Windows 7 (2009) or higher. If you don't have a supported version of the operating system, you'll need to either upgrade or do your class work on a cluster machine. You can check your version of Windows using these instructions.

  1. Remove any older copies of the Java Runtime Environment that may be installed on your system.
  2. Download and install the Java SDK for Windows
  3. Download and install Eclipse for Windows
  4. Extract the contents of the file by right-clicking on it, selecting the Extract All... option and typing C:\Program Files as the location to extract the files to. Then continue following the steps in the extraction process.
  5. Create a shortcut to Eclipse on your Desktop for easy access: Open the C:\Program Files\eclipse directory, and right-click and drag the eclipse.exe file (the Eclipse application) to your desktop and then select the option Create shortcut here.
  6. Note: If you installed the 64 bit versions of the software, and find that you have issues running Eclipse, we recommend that you uninstall the 64 bit versions of both the JDK and Eclipse and install the 32 bit versions of both:
  7. Now you'll need to install the 106A-specific customizations. Skip to the section "Installing the CS106A Plugin" further down the page for more information.

(Both Mac and Windows) Installing the CS106A Plugin

Once you have installed Eclipse, you will need to follow these instructions to add the customizations we have made for CS106A. The instructions are the same for Mac and Windows, even though the screenshots are taken from a Mac.

  1. When you run Eclipse for the first time, you may get a screen that looks like this:
    Eclipse Workspace Launcher dialog
    A workspace is just a directory that Eclipse will use to place new projects in. In 106A you won't have to make any new projects from scratch. We will always give you skeleton projects for your assignments, so you don't need to worry about where the workspace is. The suggested location is fine. Click the Use this as the default and do not ask again checkbox, and then click OK.
  2. When starting Eclipse for the first time, you may be greeted with a Welcome pane. Click the checkbox in the bottom right to disable this, and click the "X" at the top of the welcome tab to close it.
  3. click Help -> Install New Software.
  4. In the "Work with" text box, type https://web.stanford.edu/dept/cs_edu/eclipse/plugin and press Enter.
  5. Click "Select All," then click Next.
    Eclipse Install Software dialog
    (Note that the "Work with" URL in the image may be different than the one you should enter.)
  6. Click Next again.
    Eclipse Install Details dialog
  7. Click "I accept the terms of the license agreement," then click Finish.
    Eclipse License Agreement dialog
  8. If presented with a prompt confirming you want to install, confirm the installation
    Eclipse Security Warning dialog
  9. Click Yes when asked to restart Eclipse.
  10. After restarting, you should see a "Stanford Menu" in the top bar, as well as several new icons in your top toolbar area.
    Eclipse finished setup
  11. Now that you have Eclipse set up, your next step is to create a new project in your workspace by importing a skeletal framework that we provide called a starter project. Using starter projects makes your life much easier by allowing you to ignore the many details involved in creating a project from scratch. Every assignment will include a starter project for each problem, and your first task will be to download the starter project from the class website and then import it into your workspace. The details for doing so are described in the handout "Using Karel with Eclipse".

Troubleshooting