Lab 1: Setting up

Part 1: Computation, Parallelism, Debugging and Testing (50 min)

Fall 2015: Handout

Part 2: Lab (60 min)

Checklist:


Eclipse Lab Setup Checklist


IT Issues


Setting up Piazza

Piazza web interface: Piazza

Don't spend too long on this. Use the web interface to read a message. Note that you can change the default settings so that you get a summary of daily emails.


Writing "Hello World" in Eclipse

  1. Open Eclipse (a link to Eclipse 3.7 should be on the desktop or from desktop click Menu->Applications->EWS Software->Eclipse IDE)
  2. If you are asked to select a workspace, check "Use this as default" and click "OK".
  3. If you are placed in the "Welcome" screen (6 fancy circular icons), click the arrow icon on the right that says "Go to the Workbench".
  4. Once you're in the code view, make sure you're in the right perspective by clicking the "Open perspective" icon in the upper right corner, selecting "Other..." and choosing "Java" and clicking "OK".
  5. Make sure the compiler is set to the correct version. Go to "Window" menu, "Preferences", expand the "Java" link on the left side, select "Compiler" and then check that "Compiler compliance level" in the upper right is set to 1.5 or 1.6, but not 1.4.
  6. Go to File->New Java Project, give your project a name, then click "Finish".
  7. Right click your Project, go to New->Class, give it a name, check "public static void main(String[] args)", and click "Finish".
  8. Now you're ready to write "Hello World". When you're ready to run it, right click your .java file (in the explorer on the left), go to Run As->Java Application.
  9. To make your program print something, add the following inside the main method braces '{}':
public static void main(String[] args) {
  System.out.println("Hello"); //<--- Add this line!
}

Setting up Subversion in Eclipse

Your SVN Repository is where your projects are installed, and the URL is as below:

https://subversion.ews.illinois.edu/svn/fa15-cs125/YourNetId
(Replace YourNetid with your netid, the first part of your email address ___@illinois.edu)

You need to add TWO repositories. To do so, you need the SVN Repository Perspective. (Window Menu>> Open Perspective >> Other..., Select SVN Repository Explorer):

  1. In the SVN Repository Perspective, right click and select New->Repository Location...
  2. If you mess up the perspective, just click Window Menu>Reset Perspective.
  3. In the window that comes up, put in your repository URL from above and click "Finish".
  4. Eclipse will ask you for a login and password. These are the same login and password you use for the EWS workstations. Login is your NetID and your password is your Active Directory password. You should save your password so you don't need to type your password each time.
  5. If a window comes up asking if you want to accept the certificate, click "Accept and Save".
  6. You can now see your repository. To see what is in your repository, right click on the repository and click "Refresh".

Installing the Eclipse SVN Plug-in for laptop users (Subclipse)

See Eclipse and SVN Instructions


Committing your code (saving your progress)

  1. Right click your project, go to "Team" and select "Commit".
  2. Make sure all the files in the list are checked.
  3. Type an optional comment that reminds you of what you worked on in this project.
  4. Click "OK".

Importing a project from SVN into Eclipse (loading your project from your home computer or a lab computer once it's been saved)

  1. Go to the "File" menu and select "Import..."
  2. Double click "Other" and select "Checkout projects from SVN".
  3. Click "Next".
  4. If you have your repository already listed, select it and click "Next". If not, enter the url https://subversion.ews.illinois.edu/svn/fa15-cs125/yourNetId where "yourNetID" is replaced by your own netID.
  5. A list of your saved projects will be shown. Select the one you want and click "Finish".

Demonstration and notes for the Lab Assistant

The SC0224 lab machines do have the subversion plugin pre-installed. Students will need to follow the Eclipse and SVN Instructions to install the plugin and add their repository. Note that Eclipse and Java are already downloaded.

If students bring a laptop, they can work on that instead. Note Java and and Eclipse downloads are available locally (see Eclipse and SVN Instructions.)

Warning: Lab assistants and a few late add students may not have svn repository access yet. If this happens get a list of netids and then submit a manager request email requesting access to https://subversion.ews.illinois.edu/svn/fa15-cs125/NETID.

Helpful Demonstration Notes:


Creating a Demonstration

  1. Create a new Java project 'TakeOverTheWorld'. Create a class with some println's and run it.
  2. Share it (at this point you'll need the URL https://subversion.ews.illinois.edu/svn/fa15-cs125/YOUR-NETID)
  3. Point out the following: Perspectives. Reset Perspective. (Make sure you're in Java Perspective).
  4. Point out Package and SVN Repository View.
  5. Point out compile errors and svn status in the Package View.
  6. Perform a commit. Delete project locally (after checking for the lozenges).
  7. Checkout entire project using SVN Repositories View.
  8. Discuss working with two machines. Importance of no compile errors. Problems view is updated when files are saved.
  9. Point out - you can open https URL in a web browser to help debug problems.