|
Solaris 2.4, 2.5, 2.5.1, 2.6 for SPARC-based Machines and Solaris 2.5, 2.5.1, 2.6 x86-based Machines Installation Instructions | Troubleshooting | RunningApplets The installation and configuration process can be broken down into the following steps:
1. Do pre-installation checks
Before proceeding further, check that you have downloaded the full, uncorrupted software file:
The 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 links between HTML files will work properly. 2. Unpack the downloaded software file If you unpack the software or documentation in a directory that contains a directory named jdk1.1.6, the new software will overwrite files of the same name in that jdk1.1.6 directory. Please be careful to rename the old directory if it contains files you would like to keep.
% chmod a+x jdk-1_1_6_009-solsparc.bin % ./jdk-1_1_6_009-solsparc.bin % chmod a+x jdk-1_1_6_009-solx86.bin % ./jdk-1_1_6_009-solx86.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.6 containing the JDK software, with the directory structure shown below. JDK Directory Tree
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 files 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.6/bin) % source ~/.cshrc % which java If you follow the default installation, you do not need to set CLASSPATH, because the shell scripts automatically set it for you. If your CLASSPATH is currently not set, you can skip this step. 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 step 4, you must specify the path to a tool by typing the path in front of the tool.
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.6/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.6 directory that was created when you installed the JDK. For example, if you installed JDK 1.1.6, and the directory jdk1.1.6 has the path /usr/local/jdk1.1.6, you can try setting JAVA_HOME as follows: % setenv JAVA_HOME /usr/local/jdk1.1.6As 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.
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.6" 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) --> *As used on this web site, the terms "Java virtual machine" or "JVM" mean a virtual machine for the Java platform. | ||||||||||||||
|
| ||||||||||||