The Java Lab Manual

by
Jon Pearce
 
 

Preface

Java was developed by Sun Microsystems. Sun hosts a gigantic web site devoted to Java products and news. The home page of this web site is located at:

http://java.sun.com/ Downloading the SDK

Java takes the concept of freeware to a new level. Programmers can freely download the Java software development kit (SDK) at:

http://java.sun.com/j2se/ The software development kit consists of a compiler, virtual machine, applet viewer, and a few other useful tools. The SDK also consists of a large library of useful, predefined classes. There are several versions of the SDK. In these notes we are using version 1.3 of the standard edition. (Note, after version 1.1, Sun seems to have changed the name of the platform to Java 2.)

Downloading the IDE

Next, programmers will probably want an integrated development environment (IDE). There are many commercial products available, but one of the best (i.e., least worst) is Sun's Forte. The community edition can be freely downloaded at:

http://www.sun.com/forte/ffj/ce/ We will use this IDE for debugging, but for other development activities we will use the tools in the SDK plus a simple text editor. A good text editor can streamline the development process. We recommend TextPad, a shareware editor available at: http://www.textpad.com Shareware means if you like it, then you should buy it. Currently, the cost of TextPad is about $40.

Downloading the Documentation

The home page for all Java 1.3 SDK documentation is located at:

http://java.sun.com/j2se/1.3/docs/ Each class provided by the SDK has its own web page that explains what the class is for and what services the class provides. We can download these pages or we can view them on the web at: http://java.sun.com/j2se/1.3/docs/api/index.html Downloading Books

There are many books about Java, but beginners can start by freely downloading the book The Java Tutorial located at:

http://java.sun.com/docs/books/tutorial/index.html Sun also prescribes a set of style conventions for Java programs. Although not mandatory, following a standard style convention will make your programs look more professional. They will also make your programs easier to read. The Sun style conventions are specified in the book Code Conventions for the Java Programming Language, which can be downloaded or read at: http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html More advanced programmers may need to consult The Java Language Specification for detailed information on how Java works. This can be downloaded or read at: http://java.sun.com/docs/books/jls/html/index.html A good, comprehensive guide to Java is the latest edition of Core Java, Volume 1, by Horstmann and Cornell. Unfortunately, readers will have to actually pay for this book.

Downloading Programs

Programmers may wish to skip the programming phase altogether. Several sites contain free programs that can be downloaded. These sites also have answers to frequently asked questions (FAQs), discussion groups, gurus, and other useful features. One example is the Gamelan site located at:

http://gamelan.earthweb.com/ IBM is one of the biggest promoters of Java. Their site, Java Technology Zone, is located at: http://www.ibm.com/developer/java/
Table of Contents
Lab 1: The Windows Command Console I
Lab 2: Editing, Compiling, and Testing Java Programs
Lab 3: Building Simple Web Pages
Lab 4: Documenting Java Programs
Lab 5: Platforms, Packages, and Archives
Lab 6: Debugging Java Programs
Lab 7: The Windows Command Console II
Note: Debugging has been moved to Lab 6