Project 0: Hello, World
Started: Tuesday 2/8
Overview
You may use Eclipse for your programming in this course, one of the most widely-used Integrated development environments (IDE) in the industry. Eclipse has many features that help you edit, develop, test, and debug your programs. The purpose of this project is to give you a first glimpse at some of those features. In particular, you will be doing some variations of the Hello World program described in section 1.1 of our textbook.
Remarks about using Eclipse
- Eclipse is a free and open source software system, and we encourage you to download it to use on your personal computer. See the instructions for installing Java and Eclipse page to see how to do this.
- Our computer lab (Olin 326) has dual-booting computers (Mac OS X and Windows 7), both of which have Eclipse installed. If you have a laptop computer and want to use it for the course, we encourage you to do so.
- Eclipse stores your files in what it calls a workspace, which is simply a folder on your computer or storage device. Unfortunately, Eclipse does not allow you to store your workspace on the network drive. This means that you will either need to use your computer (with Eclipse loaded) or you will need to use a flash drive to store your workspace. We expect that most of you have flash drives already (they are fairly cheap and are a good way to back up data). However, if you don't have one, the department can loan you one for the semester.
- The Mac version of Eclipse is set up so that you can use a workspace in a temporary folder, which will be erased when you log out. You can, however, copy this folder to your home directory on the network drive. This is a bit klutzy, but will allow you to try Eclipse out on the first day, and also to work when you forget you laptop or flash drive. Since the network drives are backed up nightly, we recommend that you copy your workspace to the network drive regularly anyway.
- I will explain and demo this lab as if you are doing it on a Mac, since it would be too confusing to explain it for both platforms. The differences between Mac Eclipse and Windows Eclipse are not very great, so you should be able to use it on either system.
Specific tasks
If you have a flash drive, insert it either into the left side of your keyboard or into one of the ports on the CPU. Create an empty folder on the flash drive named
mcs178(or some other name you prefer).Launch Eclipse, which should be on your dock, slightly right of center (it takes a few seconds to launch, so be sure to wait). It will then ask you to select a workspace, offering you something like
/private/tmp/username/Documents/workspace(with your username, of course). If you are not using a flash drive, use this workspace. If you are using a flash drive, you should select the folder you created in step 1.Once it has fully launched, you will see Eclipse's Welcome screen. First click on the green button in the upper left to maximize the window. Then click on the "Tutorials" link, followed by the "Create a Hello World application" link. Stop at this point so that we can work through this tutorial together.
After having finished the previous step, I want you to fully delete the HelloWorld project (just to see how it is done).
Next, create a project named "Project0" and recreate and run the HelloWorld program.
After doing this, create a new java class called UseArgument, and then enter the code on page 8 of our textbook. Run this.
Now, do exercise 1.1.5 on page 13 of the textbook. If you still have time, you can try the other exercises on page 13.
Finally, submit all your java source files through moodle. Use the procedure described in our instructions on submitting code document.
Final comments
You should play around with Eclipse to get to know its features. You can get back to the Welcome screen (which has the link to the Tutorials) from the Help tab. There is another option in the Help tab to Help Contents, which loads an help system in your browser which will tell you a lot about Eclipse.