The purpose of this exercise is to have you compile and run a small piece of Java code.
If you haven't already done so, make a www directory:bigbird[1]% mkdir www
%bigbird[1]%chmod 755 www
This allows you to access this directly from a web browser. We'll explain what this means some other time, or try typing "man chmod".
Change into the www/lab1 directorybigbird[1]% cd www/lab1
Now make a subdirectory here
bigbird[1]% mkdir FirstProject
bigbird[2]% chmod 755 FirstProject
bigbird[2]% cd FirstProject
bigbird[3]% cp -r /home/acct3/mmmartin/cs1/Source_Code/Chapter01/*.* .
bigbird[3]% mkdir simpleIO
bigbird[3]% cp -r /home/acct3/mmmartin/cs1/Source_Code/Chapter01/simpleIO/*.* ./simpleIO
FirstProgram.html
FirstProgram.java
PeopleInfo.java
bigbird[5]% javac FirstProgram.java
FirstProgram.class
FirstProgram.html
FirstProgram.java
PeopleInfo.class
PeopleInfo.java
You may examine the .java and .html files in xemacs (or any other editor). The .html file contains commands that call on the FirstProgram.class file. This is why you must compile the program before you can run it.
bigbird[7]% appletviewer FirstProgram.html
A viewer window will open. You can click on the buttons to view see a demonstration of the applet. When done, click on the window close box on your machine. On a Mac, if the upper left corner is not visible, resize or move the window to access the "Close Box" at the upper left corner to close the viewer.For reasons that aren't clear at the moment, appletviewer will not run through MacX. (SIGH). You'll have to view your program through a browser such as netscape. Before you can do this you must set the protections on the files in the directory. You can do this when you are in that directory by typing:
bigbird[8]%chmod 644 *.*Now open a web browser and go to the URL.
For example: http://www.tcnj.edu/~yourname/lab1/FirstProgram/FirstProgram.html