Installation Notes
Java Development Kit v 1.1.8
Installation Instructions |
Troubleshooting |
Running Applets
|
Solaris Installation Instructions
<version number>
For example, if you are downloading update 1.1.8_009, the following
chmod command:
% chmod a+x jdk-1.1.8_<version number>-solaris-sparc.bin
would become:
% chmod a+x jdk-1.1.8_009-solaris-sparc.bin
The installation and configuration process can be broken down into the following steps:
1. Do pre-install ation checks
Before you download a file, notice that its byte size is provided on the download page. Once the download has completed, check that you have downloaded the full, uncorrupted software file.
You should unbundle the JDK software bundle and the JDK documentation bundle in the same directory. (The doc bundle is available for download from step 2 of the JDK download page.) Unbundling them in the same directory ensures that links between HTML files will work properly.
You can download and install the software file and the documentation file in either order. If you've already downloaded and installed the JDK documentation, you should unbundle the JDK software file in the same directory from which you unbundled the documentation. For example, if you installed the JDK documentation at /usr/local/, then you should place the downloaded JDK software file in /usr/local/ before proceeding.
2. Unbundle the downloaded software file
If you unbundle the software or documentation in a directory that contains a directory named jdk1.1.8, the new software will overwrite files of the same name in that jdk1.1.8 directory. Please be careful to rename the old directory if it contains files you would like to keep.In a shell window, execute the commands listed below. Note that this temporarily creates a README file in the current directory (which will overwrite any README file you might have).
% chmod a+x jdk-1_1_8_<version number>-solaris-sparc.bin
% ./jdk-1_1_8_<version number>-solaris-sparc.bin
% chmod a+x jdk-1_1_8_<version number>-solaris-i586.bin
% ./jdk-1_1_8_<version number>-solaris-i586.bin
This will bring up a license for you to read. If you agree, type yes, hit Return, and it will create a directory called jdk1.1.8 containing the JDK software, with the directory structure shown below.Included in the unbundled 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.
JDK Directory Tree
The JDK software and documentation directories will have the following structure. The docs directory and its contents will be installed when you download and unbundle the JDK documentation.
jdk1.1.8 _________________________|________________ | | | | | | | | | | | README | | | bin lib | demo | docs | CHANGES | | | | include | src | | COPYRIGHT | | | | | LICENSE index.html |
The src directory shown above originally appears as a src.zip file in the Solaris installation, which you may manually unzip to obtain access to the source code for the JDK class libraries. However, you must use an unzip program that maintains long file names. Such unzip utitilities may be found at UUNet FTP Site.3. Delete the original files you downloaded
If you want to recover disk space, delete the file you downloaded.4. Update path and environment variables
It is possible for you to run the JDK without modifying any system environment variables (such as PATH or CLASSPATH) or modifying your startup file (~/.cshrc). However, you should test that CLASSPATH is not set, and most developers set PATH as a convenience.
Set the path variable if you want to be able to run the executables (javac, java, javadoc, etc.) from any directory. If you don't set the path variable, you need to specify the path to the executable when running it. The path variable is merely a convenience to the developer and not necessary to set.
% which javaThis will print the path to the java tool, if it can find it.
set path=($path /usr/local/jdk1.1.8/bin)
% source ~/.cshrc % which java
If you follow the default installation, you do not need to set CLASSPATH, because the compiler and other tools automatically find the Java platform classes. If your CLASSPATH is currently not set, you can skip this step.
% echo $CLASSPATHIf it is set, you can unset the current value by typing:
% unsetenv CLASSPATHAlso open your startup file (~/.cshrc) or script and remove the path to the JDK classes from the CLASSPATH environment variable if you want the change to be permanent.
.:[bin]/../classes:[bin]/../lib/classes.zipwhere [bin] is substituted by the absolute path to the jdk1.1/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).
For more information on CLASSPATH, see http://java.sun.com/jdk/1.1/docs/tooldocs/solaris/classpath.html.
Your computer system should now be configured and ready to use the Java Development Kit. You start a tool by typing its name at shell window command line, with a filename as an argument. If you didn't set the path variable to point to the tools in the previous step, you must specify the path to a tool by typing the path in front of the tool.
For example, if the JDK is installed at /usr/local/jdk1.1.8, you can run the JDK's complier, javac, by doing either of the following:
Type: /usr/local/jdk1.1.8/bin/javac myfile.javaRefer to Solaris Troubleshooting the Installation below if you have problems running the JDK.-or-
Add /usr/local/jdk1.1.8/bin to your path statement
Type: javac myfile.java
The AppletViewer is a application for running and viewing applets in a window. You can start the AppletViewer by executing the following, assuming you have already set your path (as described above):
% cd jdk1.1.8/demo/TicTacToe
% appletviewer example1.html
Documentation for all the JDK tools can be found in your installed JDK directory structure at jdk1.1.8/docs/tooldocs/solaris/index.html or on tools reference page (http://java.sun.com/products/jdk/1.1/docs/tooldocs/solaris/index.html on the Java Software website.
Troubleshooting the Installation
The JDK's installation script does a checksum to insure that the software bundle was not corrupted during the download. If the checksum indicates that your file is corrupted, delete the file and download a new copy.
If you are getting the fatal error message: Exception in thread NULL, when running java, javac, or appetviewer, you should check your CLASSPATH environment variable. It may list the 'classes' directory from an older JDK release. You can either unset the CLASSPATH variable, or set it to include only the latest version of the JDK class library. For example:
% setenv CLASSPATH .:/usr/local/jdk1.1.8/lib/classes.zipThis will ensure that you are using the correct classes for this release.
If you get this error message when running one of the JDK tools such as the appletviewer, it may mean that your JAVA_HOME environment variable is not set properly. Normally, you shouldn't have to worry about setting JAVA_HOME. However, some Java IDEs set the JAVA_HOME variable to a value that won't allow you to run from the JDK. Check to see if your JAVA_HOME value has been set by using the echo command:
% echo $JAVA_HOMEIf a value is set for JAVA_HOME, unsetting it should allow you to run the JDK tools. You may want to make a note of the current JAVA_HOME setting before you unset it, in case you want to restore it later. You can unset the JAVA_HOME environment variable as follows:
% unsetenv JAVA_HOMEIf you still cannot run the JDK tools after unsetting JAVA_HOME, you can try setting JAVA_HOME to the absolute path of the jdk1.1.8 directory that was created when you installed the JDK. For example, if you installed JDK 1.1.8, and the directory jdk1.1.8 has the path /usr/local/jdk1.1.8, you can try setting JAVA_HOME as follows:
% setenv JAVA_HOME /usr/local/jdk1.1.8As long as you have not disturbed the bin and lib directories that are immediately below the jdk1.1.8 directory, you should be able to run the JDK tools.
This error message indicates that your JAVA_HOME environment variable has been set to a value that is not compatible with running the JDK tools. You should try to correct the problem by following the suggestions given above under "Error Message: Could not read properties file".
Running Applets With The Appletviewer
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.8" directory and then execute:
% bin/appletviewer demo/GraphLayout/example1.htmlHere is an example of how to invoke AppletViewer on a URL-based web page in Windows. Execute:
% bin/appletviewer http://java.sun.com/applets/Blink/example1.html
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.htmlYou can find documentation on the debugger and its API at:
http://java.sun.com/products/jdk/1.1/debugging/
|
| ||||||||||||