Lab 1: Setting up
Part 1: Computation, Parallelism, Debugging and Testing (50 min)
Spring 2017: Handout
Part 2: Lab (60 min)
Checklist:
Eclipse Lab Setup Checklist
- For your own laptop:
- For the Lab machines:
- (info) Open Eclipse preferences (Menu->Window->Preferences)
- (info) Select Android on the left pane and enter Android SDK :
/software/android-sdk-latest-el6-i686 then hit Apply.
- (info) You'll also need to add two subversion
repositories: _shared and your own. (see details in the Eclipse and SVN
Instructions)
IT Issues
- If another student is still logged on, just reboot the machine
(CTRL-ALT-DELETE) or hold the power button for 4 seconds.
- If Eclipse freezes because the Google feedback window pops up while the
Preferences window is open, click "Cancel" in the Preference's window.
- If you cannot login on one machine, try another. If that doesn't work,
report your netid and machine ID by sending an email.
- If Eclipse does not start, send an email.
- If you or a student does not have access to subversion, and they enrolled
>24hrs, send an email.
- Note that the podium machine and machine #7 have loose network cables. If
you can't log in, check that the yellow ethernet cable is fully inserted and
the network light, next to the cable at the back of the machine, is
on.
Setting up Piazza
Piazza web interface: Piazza
- Ceate an account on 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
- Open Eclipse
- If you are asked to select a workspace, check "Use this as default" and
click "OK".
- 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".
- 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".
- Go to File >> New >> Java Project, give your project a name, then click
"Finish".
- Right click your Project, go to New >> Class, give it a name, check
"public static void main(String[] args)", and click "Finish".
- 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.
- 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!
}
Committing your code (saving your progress)
- Right click your project, go to "Team" and select "Commit".
- Make sure all the files in the list are checked.
- Type an optional comment that reminds you of what you worked on in this
project.
- 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)
- Open your SVN Perspective
- Expand the repository ending in your NetID (i.e. the one that is not _shared)
- Refresh the repository if you need to
- Right-click one of the folders (like Challenge1 when the first MP is released) >> Check Out
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/sp17-cs125/NETID.
Helpful Demonstration Notes:
- Speak loudly. We can't hear you at the back!
- Increase font size in Eclipse:
Window>Preferences->Type "Font" in the search bar. Set the font size to
16.
Creating a Demonstration
- Create a new Java project 'TakeOverTheWorld'. Create a class with some
println's and run it.
- Share it (at this point you'll need the URL
https://subversion.ews.illinois.edu/svn/sp17-cs125/YOUR-NETID)
- Point out the following: Perspectives. Reset Perspective. (Make sure
you're in Java Perspective).
- Point out Package and SVN Repository View.
- Point out compile errors and svn status in the Package View.
- Perform a commit. Delete project locally (after checking for the
lozenges).
- Checkout entire project using SVN Repositories View.
- Discuss working with two machines. Importance of no compile errors.
Problems view is updated when files are saved.
- Point out - you can open https URL in a web browser to help debug
problems.