Creating a New Program

 

Step 1: Create a new project.

(1)   Select command FileNewProject. This brings up a dialog box that looks like the following:

 

proj6.jpg

 

(2)   At A in the picture, type in the name of the project. The name must be unique and should not have any spaces. Begin the name with a capital letter and capitalize the beginning letter of each word in the name, e.g. MyProject.

 

(3)   At B in the picture, make sure that the Project layout is set to "Use project folder as root for sources and class files". If this is not selected you can just click on the radio button next to it. However, you can also set this as the default for all new projects by clicking on the Configure default link. This will bring up another dialog box like this:

 

 

proj3.jpg

 

If the Folders choice is currently selected, click on the Project button instead, so that it looks like this:

 

proj2.jpg

 

Now click on OK to return to the New Project dialog box, which should now look like this:

 

proj5.jpg

 

 

You can now click on the Finish button. You have just created a new project called MyProject.

 

 

Step 2: Create a new program file.

 

Your Eclipse window should look something like this (though without all of the projects listed on the left):

 

eclipse5.jpg

 

 

(1)   Click on the MyProject project in the Package Explorer pane (along the left side) of the window, so that it is highlighted (i.e. selected - see A in the figure).

 

(2)   Click on the New Java Class button in the tool bar (see B in the figure). You will see a new dialog box like this:

class4.jpg

 

(NOTE: If you accidently click on the little arrow to the right of the New Java Class icon, it will drop down a list that you must select Java Class from.)

 

(3)   At A, enter the name of the program you are creating. As in the case of the project name, you should avoid spaces and use initial capital letters for all words, e.g. MyProgram.

 

(4)   At B, click on the public static void main(String[ ] args) button.

The dialog box should now look something like this:

class5.jpg

 

Click on the Finish button. This returns you to the main Eclipse window, which should now look something like this:

 

eclipse6.jpg

 

 

You are now ready to write the code for your program.