Microsoft Windows NT (x86) and Windows 95 / 98
The installation and configuration process can be broken down into the following steps:
1. Run the JDK installer, if necessary
If you downloaded the JDK software file instead of running the installer from the JavaSoft web site, you should check to see that the complete file was downloaded:2. Update PATH and CLASSPATH variables
jdk-1_1_6_009-win.exe 8,920,349 bytesThe JDK software file and the JDK documentation file (available for download from step 2 of the JDK download page) should be unpacked in the same directory. Unpacking them in the same directory ensures that HTML links in the JDK documentation and demo files will work properly.
You can download and install the software file and the documentation file in any order. If you've already downloaded and installed the JDK documentation, you must unpack the JDK software file in the same directory from which you unpacked the documentation.
To run the JDK installer, double-click on the icon of the downloaded file. Follow the instructions the installer provides. When done with the installation, you can delete the download file to recover disk space.
Installed Directory Tree
The JDK software and documentation directories will have the following structure. Thedocsdirectory and its contents will be installed when you download and unpack the JDK documentation.jdk1.1.6 _________________________|________________ | | | | | | | | | | | README | | | bin lib | demo | docs | CHANGES | | | | include | src | | COPYRIGHT | | | | | LICENSE index.htmlIncluded in the unpacked files is a file
lib/classes.zip. DO NOT UNZIP THE CLASSES.ZIP FILE. This file contains all of the core class binaries, and must remain in its zipped form for the JDK to use it.
It is possible for you to run the JDK without modifying any system environment variables (such as PATH or CLASSPATH) or modifying AUTOEXEC.BAT. However, you should test that CLASSPATH is not set, and most developers set PATH as a convenience.Windows NT only - If you are using Windows NT, it is preferable to make the following environment variable changes in the Control Panel instead of in
autoexec.bat. Start the Control Panel, select System, then edit the environment variables.
C:>
path
PATH C:\WINDOWS;
C:\WINDOWS\COMMAND;
C:\;C:\DOS
; C:\JDK1.1.6\BIN
C:>
autoexec.bat
TESTING AND UNSETTING CLASSPATH
If CLASSPATH is set and you want to unset it, you typically need to change the current value (at the command line) and the startup value (in a startup file or script). For example, to see if it is currently set, type:
C:>
set
This lists all of the environment variables. CLASSPATH will not appear if it is not set. If it is set, you can unset the current value by setting it to no value:
C:>
set CLASSPATH=
Also open your startup file (autoexec.bat) or script and remove the path to the JDK classes from the CLASSPATH environment variable, if you want the change to be permanent.
WHAT CLASSPATH DOES
The CLASSPATH tells the Java Virtual Machine* and other Java applications (which are located in the "jdk1.1.6\bin" directory) where to find the class libraries, such as classes.zip file (which is in the lib directory). By default, the java tools temporarily append the following to whatever CLASSPATH you have explicitly set in your startup file:
.;[bin]\..\classes;[bin]\..\lib\classes.zip
where [bin] is substituted by the absolute path to the jdk1.1.6\bin directory. Therefore, if you keep the bin and lib directories at the same directory level (that is, if they have a common parent directory), the Java executables will find the classes. You need to set the CLASSPATH only if you move classes.zip or want to load a different library (such as one you develop).
Refer to the Windows Installation Troubleshooting section below if you have problems running the JDK.
You can specify the path to a tool either by typing the path in front of the tool each time, or by adding the path to the startup file (autoexec.bat). For example, if the JDK is installed at C:\jdk1.1.6, to run the compiler on a file myfile.java, go to a DOS shell and execute this:
Type: C:\jdk1.1.6\bin\javac myfile.java
-or-
Add C:\jdk1.1.6\bin to your path statement
Type: javac myfile.java
You can start the AppletViewer by executing the following, assuming you have already set your path (as described above):
Use cd to change to a directory containing an html file that embeds an applet:
C:\>
cd jdk1.1.6\demo\TicTacToe
Run the AppletViewer passing in the html file: C:\JDK116\DEMO\TICTACTOE> appletviewer example1.html
net.socketException: errno = 10047
-or-
Unsupported version of Windows Socket API
check which TCP/IP drivers you have installed. The AppletViewer supports only the Microsoft TCP/IP drivers included with Windows 95/98. If you are using third-party drivers (e.g., Trumpet Winsock), you'll need to change over to the native Microsoft TCP/IP drivers if you want to load applets over the network.
If none of these work, try:
java -verbose sun.applet.AppletViewer
This lists the classes that are being loaded. From this output, you can determine which class the AppletViewer is trying to load and where it's trying to load it from. Check to make sure that the class exists and is not corrupted in some way.
C:\> set CLASSPATH=.;C:\jdk1.1.6\lib\classes.zip
This will ensure that you are using the correct classes for this release.
set
set JAVA_HOME=
jdk1.1.6 directory that was created when you installed the JDK. For example, if the directory jdk1.1.6 has the path C:\java\jdk1.1.6, you can try setting JAVA_HOME as follows:
set JAVA_HOME=C:\java\jdk1.1.6
As long as you have not disturbed the bin and lib directories that are immediately below the jdk1.1.6 directory, you should be able to run the JDK tools.
AppletViewer allows you to run one or more Java applets that are called by reference in a web page (HTML file) using the APPLET tag. The AppletViewer finds the APPLET tags in the HTML file and runs the applets (in separate windows) as specified by the tags.
AppletViewer is for viewing applets. It cannot display an entire web page that contains many HTML tags. It parses only the APPLET tag and no other HTML on the web page.
To run an applet with appletviewer, you go to a command line for your operating system and run appletviewer, passing in the filename or URL of the web page as its argument.
Here is an example of how to invoke AppletViewer on a file-based web page in Windows. Go to a DOS prompt, change to the "jdk1.1.6" directory and then execute:
C:\
bin\appletviewer demo\GraphLayout\example1.html
Here is an example of how to invoke AppletViewer on a URL-based web page in Windows. Execute:
C:\>bin\appletviewer #
Debugging Programs With The Java Debugger (Jdb)
You can debug applets using the -debug option of appletviewer. When debugging applets, it's best to invoke appletviewer from the directory that contains the applet's HTML file. For example, on the PC: cd demo\TicTacToe ..\..\bin\appletviewer -debug example1.html
You can find documentation on the debugger and its API at:
#
*As used on this web site, the terms "Java virtual machine" or "JVM" mean a virtual machine for the Java platform.