Samuel Marateck, 2008 Note that the jdk bundle is already on you MAC; it's pre-installed. To compile and execute your program using the command line on the MAC, do the following: 0. Get TextEdit from the Applications folder on the Finder. 1. On TextEdit menu choose Preferences, click the New Document tab, and then choose plain text. Then click the Open and Save tab and make sure that "Add '.txt' extension to plain text files" is unclicked. 2. Type your program and save to the desktop, e.g., saveAs Prog1.java. The ".java" part is essential. If the system asks whether you want to save your program as ".txt" or ".java", choose ".java". 3. Using the finder (it's the icon at the bottom left of your screen) get the utilities folder in the applications folder and there click the terminal icon. In terminal,type: cd desktop. 4. At what is called the "command line" Javac your program, i.e., type javac Prog1.java If your program compiles, you will get no message. 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 or from the example directly below, substitute yout program name in the code line, e.g., code = "Hw2.class" 3. Save the html file to the desktop. If you don't do this, your applet will not execute. 4. Type: appletviewer Temp.html An example of a html file (where the background color is white) is