To compile and execute your program on the MAC, do the following:

1. In textedit choose preferences and then choose plain text.

2. Type your program and save to the desktop

3. In terminal,type: cd desktop.

4. Javac your program, i.e., javac Prog1.java

5. Execute your program, e.g., java Prog1

If you want to run an applet, do the following at the command line:

1. Compile your program, e.g., javac Hw2.java

2. Copy the temp.html file from the class page, substitute yout program name in the code line, e.g., code = "Hw2.class"

3. Save the html file. If you don't do this, your applet will not execute.

4. Type: appletviewer Hw2.html