Close
Register
Close Window

Software Design and Data Structures

Chapter 1 Introduction

Show Source |    | About   «  1.1. Welcome to CS2114   ::   Contents   ::   1.3. Java Fundamentals  »

1.2. Setting Up Your Programming Environment

Students with synchronous lab sections are encouraged to attend the first week for assistance with this setup process.

1.2.1. Downloading and Installing Eclipse

This course teaches programming using Java. We will use the Eclipse Integrated Development Environment for code development in class, including all examples shown. The instructions here include the user libraries necessary for assignments in this course, and programming assignments will not compile without these.

Note

Note: this setup involves multiple steps and it’s not uncommon for students to miss something their first time through. If you’ve installed everything but can’t get any code to run at all, it’s good to try uninstalling Eclipse and just installing it again.

   1. Open https://www.eclipse.org/downloads/packages/installer
  1. Click on the Download link in the box at the top that matches your computer.

    Which version of Eclipse should I download? 32 or 64-bit? x86_64 or AArch64?

    It is important to download the correct version of Eclipse for you computer’s operating system.

  2. After the download is complete, follow the installation instructions beginning at step 2 on this page, selecting IDE for Java Developers when prompted. You will also need to accept terms and conditions.

  3. Start Eclipse. ( If you are on a Mac, you need to set System Preferences->Security and Privacy to allow apps downloaded from locations other than the Mac App Store.)

  4. The first time you start Eclipse, you’ll be asked to specify a location for the Eclipse Workspace; this is where Eclipse will keep your programming projects. You can either use the default recommendation or place it elsewhere on your file system. Check the Use this as the default and the do not ask again option, so Eclipse will not ask you every time you start it, and click Launch.

_images/SetupFig1.png

You may see a notice about a requirement needing an update. Click the checkbox Remember my Decision then select Install.

_images/SetupFig2.png

6. The initial Eclipse startup screen has a Welcome tab with an Overview, Tutorials, Samples, and a “What’s New” section.

_images/SetupFig3.png

Feel free to explore the options and then close the Welcome tab by clicking the “X” control to the right of “Welcome” near the top of the window to proceed to the Workbench.

1.2.2. Configuring Eclipse

1.2.2.1. Installing the Webcat Plugin

Now we need to install an additional plug-in to make some common tasks in this course easier.

  1. Open the Help menu and select Install New Software…:

_images/WebcatSetupFig1.png
  1. In the Work with: field, paste the following URL and press Enter (or press “Add”): http://web-cat.org/eclipse

_images/WebcatSetupFig2.png
  1. Click the check boxes next to “Web-CAT Electronic Assignments” and “Web-CAT Java Development Extras”, and click Next.

_images/WebcatSetupFig3.png

Figure 1.2.6: Review your selection and click Next again.

If the Install Remediation Page appears, then select the second radio button to “Update my installation to be compatible with the items being installed”.

If the Trust dialog appears, click on Select All followed by Trust Selected.

  1. Check “I accept the terms of the license agreements” and then click Finish.

_images/WebcatSetupFig4.png
  1. Wait while the plug-in is being downloaded and installed. This may take a few minutes. You may get a warning about installing unsigned code during the installation. Click OK (or “Install anyway”) to continue the installation.

_images/WebcatSetupFig5.png
  1. When the installation is complete, Eclipse will notify you that it should be restarted in order for the changes to take effect. Click Yes to do so.

1.2.2.2. Plugin Settings

Now that you have installed the Web-CAT plugin, you can tell it where to find and submit assignments.

  1. Once Eclipse has restarted, select Window -> Preferences… (or on MacOS, Eclipse -> Settings…) from the menu.

_images/FormattingSetupFig1.png
  1. Select Configured Assignments from the left panel.

_images/Web-CAT-2114-plugin-preferences.png
  1. Copy and paste the following two URLs into the panel. (If the line gets wrapped, make sure you don’t accidentally put any spaces in it.)

  • Download URL

    • https://courses.cs.vt.edu/cs2114/assignments.xml

  • Submit URL

    • https://web-cat.cs.vt.edu/Web-CAT/WebObjects/Web-CAT.woa/wa/assignments/eclipse?institution=VT

  1. Click the Apply and Close button to save your changes and exit the preferences window.

1.2.2.3. Customizing Formatting and Style Preferences

One of the formatting guidelines expected throughout this course is to use spaces instead of tabs in your code. This makes your code more portable between users and environments. To make this easier, we provide a code style sheet that you can import into your Eclipse settings. Once installed, you can use these keyboard commands to automatically format your code:

  • Windows: CTRL + SHIFT + F
  • Mac: Command + Shift + F

Remember to format your code before submitting to Web-CAT.

Right-Click and “Save As…” to download to download the stylesheet: https://courses.cs.vt.edu/cs2114/vtcseclipsestyle.xml

To install:

Mac:

Eclipse->Settings->Java->Code Style->Formatter->import the above file, then click OK

Windows:

Window->Preferences->Java->Code Style->Formatter->import the above file, then click OK

1.2.2.4. Customizing Preferences

To tailor Eclipse’s settings and code formatting choices for this course, download the following preferences file to your computer by right-clicking the link and choosing “Save As…” or “Save Link As…”:

vtpreferences.epf

It doesn’t matter where you save it, but do remember where it is saved.

To install:

  • From Eclipse’s menu, choose File -> Import….

  • In the Import dialog, click the arrow in front of General and select Preferences.

  • Click Next to move to the next page of the dialog.

  • Click the Browse button to the right of the field labeled From preferences file:, and find the vtpreferences.epf file you downloaded. Then click Finish to import these settings.

1.2.2.5. Adding CS2 Support Projects

Follow Along and Engage

Labs, projects, and sample code make use of one or more of the following CS 2114 Support Projects (CS2-Support, CS2DataStructuresLib, CS-GraphWindowLib). You can download the support projects via eclipse using the blue down arrow icon or using the Project Menu and selecting “Download Assignment…”.

1.2.2.6. For Future Reference As Needed:

Follow Along and Engage

To use all of our student configurations, it’s easiest to use Java 8. If you need help with this, watch the video below.

You’re all set to begin the assignments!

   «  1.1. Welcome to CS2114   ::   Contents   ::   1.3. Java Fundamentals  »

nsf
Close Window