CSCI 161 - HelloWorld Lab

Instructions

Following the steps below (deliberately given at a high level - refer to class notes if needed for specifics):

  1. Using the Eclipse IDE create a "New Java Project", give it a project name of "HelloWorld".
  2. Then, add a new class to the project and also name it HelloWorld (note camel case and no space between words), making sure to click the checkbox to add "public static void main" to the class when you create it.
  3. Add the obligatory single statement within the static void main() method that will print to standard output the string: Hello World!
  4. Test the program from within Eclipse and make sure it runs without error.
  5. Next, add at least three additional statements that will print out: My name is: followed by your first and last name, properly spaced, all on the same line.
  6. Test the program from within Eclipse and make sure it runs without error (it should now print out two lines).
  7. From a terminal window, navigate to the directory holding the HelloWorld.java file, then...
  8. Remove the HelloWorld.class file if it exists (use Linux rm command).
  9. Compile HelloWorld.java file to generate a new HelloWorld.class file (use javac command, then ls to assure file exists).
  10. Run the HelloWorld java program (using java command).
  11. Once you are sure the program compiles and runs properly submit it via AutoLab.
  12. AutoLab will automatically run and try to give a preliminary grade (max of 80pts) for your program. This program submission won't actually go into the gradebook for this course. You can try additional submissions to get the grading right (80%). Hint: you may have to remove what you added in step 5 above and resubmit.
  13. That's it!