Jdkhowto
Jdkhowto
Jdkhowto
by C. Thomas Wu
In this document, we will explain how to run Java programs using a plain JDK and Notepad. Althoug there are many possible variations, to make things simple, we will explain here one particular way that should apply to almost everybody. For this handout, we assume the Windows platform. If you are taking a class, you should check with your instructor or T.A. for instructions specific to your case.
1 of 3
For the javabook package and sample files, we assume the following directory structure: C: JavaProjects javabook SamplePrograms Ch1 . . Ch15
. .
Notice that the Java package and the OS directory have one-to-one correspondence. Make sure that the javabook directory contains all the bytecode files of the javabook package (MainWindow.class, InputBox.class, etc.)
Second, to let the Java compiler find the necessary packages, add the following line:
SET CLASSPATH=.;C:\JavaProjects
Notice that theres a dot (period) right after the equal symbol.
2 of 3
plet.java.
2. Compile MyFirstApplet.java using javac. 3. Using a text editor, create the corresponding html file MyFirstApplet.html. 4. Run the applet using appletviewer:
3 of 3