CS 2121 Introduction to Java:
Laboratory Exercise 1

January 22, 10 points


Overview

For this exercise, you will learn to work with the emacs editor on your "ub" UNIX account. You will first just create some junk files with emacs. Then you will use emacs to create a simple applet, compile the applet with the javac program, and run the applet with the appletviewer program.

Step 1 - Log Onto "ub" Using X-Win32

On UMD Windows machines, you can start up an X-Win32 terminal to our "ub" machine by doing the following.

Step 2 - Edit Some Junk Files with emacs

For this step, do the exercise desribed in the web page A Simple Introduction to the Emacs Editor. The exercise will also show you a few useful UNIX commands.

Step 3 - Write and Test a Java Applet

For this step, you should first create a new directory named "lex1" using the "mkdir" command described in Step 2. Then change directory into the new directory using the "cd" command.

Then follow instructions starting at Step 3 (Creating Your First Applet) in Your First Cup of Java (for UNIX). The instructions tell you to use pico for editing, but you should use emacs instead.

This web page is from the Java Tutorial, which we will be using from time to time in CS 2121.

Step 4 - Have Your Applet Validated

Get the attention of your instructor or TA and run your applet with appletviewer for him.

Step 5 - Shut Down the emacs, appletviewer, and X-Win32 Windows

Step 6 - Review What you Have Learned

You do not have to do this review in lab, but you should do it as soon as possible, while the lab exercise is still fresh in your mind. The best way to review is to read the web page A Useful Java Programming Environment.