Skip navigation
The Australian National University

Completing Question 1 of Lab Test 1

This question is designed to ensure that you have the skills to use the most basic tools we'll be relying on this semester. The question is not supposed to be difficult, but it does require familiarity with the tools.

  1. Start Eclipse, either using the menu, or a terminal. You should see something like this.

  2. Use "File", "New...", "Other...", and select "Create New Mercurial Repository". Then type in the location of the repository you are creating, which should be "/student/<uid>/labtest1", where you replace <uid> with your uid.

  3. You should see something like this.

  4. To coax mercurial into life, it is necessary to click on the repository (bottom of screen). Once you've done that you should see the words "Hg status pending...".

  5. Now create a Java project called "Lab Test 1", by using "New", "Java Project". Type in the name of the project, and deselect the "Use default location" button.

  6. For the location, type in (or use "Browse..." to navigate to) the location of the repository you just made.

  7. You should now see something like this. Note the little black square on the icon next to the "Lab Test 1" project. That square tells you that it is under version control and has changes that are not committed. If you don't see that square, you may have made a mistake in the previous steps. If so, it is easiest to quit eclipse, delete your labtest1, and start over.

  8. Now create a Java class called "Hello", by using "New", "Class". Ensure you type the name in correctly and ensure that the "public static void main(String[] args)" option is checked.

  9. You should see something like this.

  10. Write your one-line program that prints "Hello World".

  11. Run your program, using the green run button. You should see "Hello World" appear in the Console at the bottom of the screen.

  12. Now add your new class to the repository by placing your mouse over the class and right click to select "Team" "Add...". You should see a little blue plus sign on the icon next to "Hello.java", like this:

  13. Now commit your change by placing your mouse over the class and right click to select "Team" "Commit...". You should see the following dialog:

  14. Type in a commit message and press "OK".

  15. Your system should now look like this (note that there is no black box or blue plus next to your "Hello.java").

Updated:  01 August 2012 / Responsible Officer:   JavaScript must be enabled to display this email address. / Page Contact:   JavaScript must be enabled to display this email address.