Lesson 3

Java Program Development

There are a number of excellent Java program development environments available, including products from Sun (JDK), Microsoft (Visual J++), Borland (JBuilder) and Symantec (Visual Cafe). These all provide very friendly environments for creating and editing your source code, and compiling and debugging your programs. While it isn't the easiest to use, the lowest cost development package for Java programs is undoubtedly the Java Development Kit (JDK) from Sun, because it is free. You can download this for a variety of different hardware platforms and operating systems from the Sun Java web site at http://www.javasoft.com


An applet is a little application program. Prior to the World Wide Web, the built-in writing and drawing programs that came with Windows were sometimes called "applets." On the Web, using Java, the object-oriented programming language, an applet is a small program that can be sent along with a Web page to a user. Java applets can perform interactive animations, immediate calculations, or other simple tasks without having to send a user request back to the server.

A Java applet is a Java program that can be included in an HTML page, much as an image can be included. When you use a Java-compatible browser to view a page that contains a Java applet, the applet's code is transferred to your system and executed by the browser.

This class uses Sun's JDK 1.0.2. Here are some common commands and their purpose. They must be run from a DOS prompt.

java   program launches a Java application
javaw   run program in the Windows environment
javap   disassembles a class file
javah   creates a header file for each class listed on the command line
java_g   non-optimized version of java suitable for use with debuggers like jdb
javaw_g   non-optimized javaw
javap_g   non-optimized javap
javah_g   non-optimized javah
javac   the Java compiler
javac_g   non-optimized javac
jdb   The Java debugger
jdb_g   non-optimized jdb
javadoc   parses the declarations and documentation comments in a set of Java source files and produces a set of HTML pages describing, by default, the public and protected classes, interfaces, constructors, methods, and fields
javadoc_g   non-optimized javadoc
appletviewer   views Applets without the use of a browser
appletviewer_g   non-optimized appletviewer
hotjava_g   get a log of the HotJava session on Windows systems, you must run the command line program hotjava_g to enable logging

To see which version of JDK you are using type the following at the command prompt:
> java -version

Below is an applet, which lists code for a simple Java application.
Copy the code into an editor, compile it, and run it.

Assignment 3

- Write a Java program that spells out your name, and lists people in your family

Return to the Top