Lab 01
Setup
Objective:

Write a simple program to conform to the Google Java Coding Conventions.

Synopsis
  1. Set up your Eclipse environment to conform to Google's styleguide
  2. Set up the checkstyle tool to automatically verify your code
  3. Write a simple program to conform to the Google styleguide
  4. Verify your program conforms to the guidelines by using checkstyle
Part I: Eclipse
  1. Download the xml settings file
  2. Open Eclipse
  3. Navigate to Window→Preferences
  4. In the tree on the left, click Java→Code Style→Formatter
  5. Click Import, and import the xml file downloaded from step 1
Eclipse will now use Google Formatting by default.
Part II: checkstyle
  1. Create a folder title 'Checkstyle' on your Desktop
  2. Download the latest version of checkstyle here, and place it in the folder you just created
  3. Download the xml configuration file and place it in the same folder
Part III: Java

Write a program Greetings.java that gives a proper greeting, and introduce yourself. Also answer the following questions on each line:

Part IV: Verify

Verify your code conforms to the guidelines by doing the following:

  1. Open a run dialog by pressing Win-R (hold the windows key and press R)
  2. Type cmd and press ENTER to open a command prompt
  3. Navigate to the location of your source code
  4. Type the following (all on one line!) to check your code:

                  java -jar C:\Users\«your name»\Desktop\Checkstyle\checkstyle-6.9-all.jar
                  -c C:\Users\«your name»\Desktop\Checkstyle\google_checks.xml
                  «java file»
            

    If you see anything other than:

                  Starting audit...
                  Audit done.
            

    Your code did not pass. Fix the errors and try again

Example Dialog:

            Greetings!
            I am Dan.
            My favorite color is neon brown.
            I am a cat person.
            I love tacos.
    
Finally:

Upload the .java file to the dropbox under Lab01

Make sure it conforms to the style guidelines