COP 2253

Completing Java Programming Projects in the SAIL Lab.

 

(You must first have an active account in the lab.)

 

Login to a machine in the lab using your ArgoNet username and password.

 

Create a new folder for the work you will be doing in COP 2253.

 

Inside your COP 2253 folder create a folder for your first project. (ex. project1)

 

(Note: These folders should be saved on the disk drive allocated for your use. It will be accessible from any machine in the lab.)

 

Start the jGrasp program. (probably with these steps)

 

            Start > programs > jGrasp > jGrasp

 

It would be helpful to take a few minutes to look at the basic layout (menus, windows, etc.) of jGrasp.

 

You should have at least two windows visible inside jGrasp. One is a browse window. It has tabs at the bottom, and initially you should choose the browse tab (if it is not already chosen).

 

Inside the browse window you should be able to see your files and folders. Try it out. Locate the folder that you created for COP 2253. Now open the folder you created for your first project. It should be empty. This is where you are going to store your java files.

 

Now try creating the "Hello World." program with jGrasp".

           

            Go to the file menu and choose -  new file > java

 

You should see another window. This is where you will enter your program. Enter the "Hello world" program from class or some other program, perhaps from chapter 1 of the text. Take your time. The program will not run correctly if you make even minor errors.

 

When you have finished entering the program, save it in your new folder.

           

            In the editor window choose - save as

            Note: the file name must match the class name and have the extension (.java).

 

     Example:

                        If your class is named HelloWorld,

                        then your file must be save as HelloWorld.java

 

Your new file should now be listed in the browse window.

 

Now you will do two things to test your program:

 

            1. You will compile it which translates the java file into byte codes.

                        (Note: This will produce a file named HelloWorld.class)

 

                        Go to the compiler menu and choose - compile

 

                        If you have made any errors entering the program the compiler will identify them and try to

                        let you know what they are. Messages from the compiler will be displayed in the messages

                        window at the bottom of the screen. When the compiler has finished, it will indicate that

                        the operation is complete (again, in the messages window).

 

            2. If the program was compiled correctly (no error messages), then it is ready to run (execute).

 

                        To run the program go to the run menu and choose - run

 

          The output generated by the program will again be displayed in the messages window.

                        (Note: The messages window has several tabs.)

 

You have successfully written, debugged and tested your first java program.

 

At this point you can proceed as you like. Test drive your new skills. The more comfortable you become

with the environment, the more productive you will be. Don't be afraid to experiment!!!

 

When you are done with jGrasp, close it up and then open the folders you created at the beginning of this session.

You should see all of the files you created.

 

Be sure to logout of your ArgoNet account!!!