Introduction to Java using JDK 1_2_1 and Kawa

Students with their own computers can download the Java Development Kit (JDK) 1_2_1 from the Sun website. The URL is JDK 1_2_1 is approximately 20.5 MB. The development environment that we will use is called Kawa. It can be downloaded from for $25 (educational price). Both the development kit and the editor will be available in the computer lab in the fall.

After installing Kawa and JDK, open Kawa and register your copy. To register your copy, you should go to the Kawa web site and pay $25. They will then send you the registration key. Enter this information in the boxes provided.

When you next open Kawa, you will see the following screen.


Next you must set the path correctly to link Kawa to the JDK compiler and libraries. Click on Customize and then on Options. You should see the following screen. In order to browse through your hard drive to find JDK, click on the two arrows (>) at the end of the first row. Once your are finished, your screen should look something like the following. However, you would more likely have the files on drives C or D, rather than drive E.


Once the options have been correctly set, you can create a new project. To do this, first click on Project and then on New. You will then see the following screen. Fill in a name for the project. It is called Lincoln.kawa in the example.


Next click on File and then New. This will give you a blank screen on the right. Enter the following small Java application. It is from the text by Lewis and Loftus, page 34.

//Prints a quote from Abraham Lincoln

class Lincoln

{

publicstaticvoid main (String [] args)

{

System.out.println ("Whatever you are, be a good one.");

} // method main

} // class Lincoln

When done, save it as Lincoln.java and add it to your project. The name of the file must be the same as the name of the class. Java is case sensitive, so be careful that you use the same upper and lower case letters in both places. You add a file to your project by clicking on Project and then on Add File. Your screen should now look as follows:


Compile your program either by clicking on the compiler icon or by choosing Build and then Compile. If the compiler indicates that you have errors, correct them and then recompile. When your program compiles without error, you may run the program by clicking on the Run Java icon or by choosing Build on the main menu and then Run. This should produce the output shown in the small window at the bottom of the screen. This can be seen in the following screen.