6.170 / Spring 2004 / Locker Instructions

Handout S11

Contents:

Using the locker

We have created space in the 6.170 locker for your group to develop files. We have initialized your locker with a CVS repository.  You'll need to create your project in this repository.  The instructions below will help you do that.

Creating a new project

Assume your group number is seMMN. Do the following steps only once per group to create your initial project in the CVS repository.

If any of your group members want to use Eclipse, then you should create your initial project using Eclipse, because that's the easiest way to get Eclipse's .project and .classpath files into CVS.  If all of you are happy to stay at the command line, then you can follow the command line instructions, which won't create .project or .classpath.

Eclipse Command Line
  1. Launch Eclipse using runeclipse.
  2. Select File >> New >> Project
  3. Create a Java project, and press Next.
  4. Name it (e.g. gb  or antichess), and  press Next.\
  5. Click Add Folder, and create a folder src under your project folder.  Select this folder before you click OK from the Source Folder Selection dialog, so that Eclipse knows that your source files will be in this folder.  When Eclipse asks "Do you want to remove the project as source folder...", say Yes.
  6. Use File >> New >> Folder to create doc and lib folders under your project folder.
  7. Right-click on your project folder and select Team >> Share Project.
  8. Choose Create a new repository location.
  9. Fill in the fields as follows:
    Host: athena.dialup.mit.edu
    Repository path: /mit/6.170/groups/seMMN/cvsroot
         (where MMN is your group number)
    User: your username
    Password: leave this field blank if you are on Athena; otherwise, enter your Athena password
    Connection type: ext if you are on Athena; otherwise choose extssh
  10. Click Finish.
  11. Commit your project folder to finish putting it in CVS.
  1. cd ~/6.170/workspace
  2. mkdir myproject   (suggested names: gb or antichess)
  3. cd myproject
  4. mkdir src lib doc
  5. cvs -d /mit/6.170/groups/seMMN/cvsroot import -m "Start" myproject seMMN start
  6. cd ..
  7. rm -r myproject
    (we're deleting the skeletal directory because you can't use it as a CVS working directory; you have to check it out again)
  8. cvs -d /mit/6.170/groups/seMMN/cvsroot co myproject

Checking out your project

Once the project has been created in CVS, your other team members can check it out as follows:

Eclipse Command Line
  1. Select Window >> Open Perspective >> Other... >> CVS Repository Exploring
  2. Right-click in the "CVS Repositories" window, and select New >> Repository Location...
  3. Fill in the fields as follows, and as shown below:
    Host: athena.dialup.mit.edu
    Repository path: /mit/6.170/groups/seMMN/cvsroot
         (where MMN is your group number)
    User: your username
    Password: leave this field blank if you are on Athena; otherwise, enter your Athena password
    Connection type: ext if you are on Athena; otherwise choose extssh
  4. Click Finish.
  5. Browse into the new repository location you just created to find the project and check it out.
  1. cd ~/6.170/workspace
  2. cvs -d /mit/6.170/groups/seMMN/cvsroot co myproject

    (where MMN is your group number, and
    myproject is the name you gave the project
    when you created it)

Importing resources into your project

You'll want to populate your project with development resources, like JAR files, images, and configuration files.

The easiest way to add files to your project is to copy them directly into your new project's directory.  If you're running Eclipse, you should then File >> Refresh so that Eclipse notices the change.

Here are some resources you'll definitely want.

Build.xml

You'll want an Ant build file. Ant allows you to automate common tasks like compiling your code, building jars and javadoc, and running tests.  You've already used it for building your Javadocs in previous problem sets.  The easiest way to get this is just to copy it from a previous problem set.

JARs

You'll want a bunch of JAR files in your project; at a minimum, you'll need junit.jar, javadoc6170.jar, and any staff-provided JAR files for the final project you chose.  You can find junit.jar and javadoc6170.jar in the lib directory of any of  your previous problem sets, and you can download the staff-provided JAR files from the final project handout.

You should put JAR files into the lib directory of your project, so that the Ant build script can find them automatically.  Unfortunately, Eclipse can't find them automatically, so you'll have to tell Eclipse to put the JAR files on its classpath:
  1. Go to Project >> Properties >> Java Build Path.
  2. Select the Libraries tab.
  3. Click Add Jars... and find the JAR files you want to add (which must already be in your project).
  4. Click OK.


Back to the 6.170 home page.
For problems or questions regarding this page, contact: 6.170-webmaster@mit.edu.