Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Support Readiness Document Java™ 2 Platform, Standard Edition, Version 1.4, Software Development Kit Overview Sun Microsystems, Inc. 901 San Antonio Road Palo Alto, CA 94303 U.S.A. 650-960-1300 March 2002 2002 by Sun Microsystems, Inc.—Printed in USA. 901 San Antonio Road, Palo Alto, CA 94303-4900 All rights reserved. No part of this work covered by copyright may be duplicated by any means—graphic, electronic or mechanical, including photocopying, or storage in an information retrieval system—without prior written permission of the copyright owner. RESTRICTED RIGHTS LEGEND: Use, duplication, or disclosure by the government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013 (October 1988) and FAR 52.227-19 (June 1987). The product described in this manual may be protected by one or more U.S. patents, foreign patents, and/or pending applications. TRADEMARKS: Java, Java 2 Platform, Java 2 SDK, JDK, J2SE, Java Virtual Machine, JVM, Java Virtual Machine Debug Interface Tool, Java Native Interface, Forte for Java, NetBeans, Java HotSpot, Java JumpStart Edition, Java 2D, Solaris, and Sun are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. UNIX is a registered trademark in the United States and other countries, exclusively licensed through X/Open Company, Ltd. Netscape is a trademark or registered trademark of Netscape Communications Corporation. Sun Microsystems, Inc. Table of Contents 1. 2. 3. Java 2 Platform, Standard Edition, v. 1.4, SDK 9 1.1 Overview 9 1.2 Features, Advantages, and Benefits 1.3 Introduction to J2SDK, v. 1.4 1.4 Specialized Terminology 9 10 10 Product Changes for Version 1.4 11 2.1 Changes and New Features in Version 1.4 11 2.2 Bugs Fixed in Version 1.4 2.3 Previous Versions of J2SDK 2.4 Backward and Forward Compatibility With Other Versions 2.5 Porting Applications to Version 1.4 11 11 12 12 Using and Supporting J2SE, V. 1.4 13 3.1 User’s Guides and Tutorials 3.2 Tools and Utilities 3.3 Localization and Internationalization 4. Code Samples 15 5. Troubleshooting 16 13 14 5.1 Product Limitations 5.2 Common User Questions 14 16 16 Sun Microsystems, Inc. Table of Contents iii 5.3 5.4 6. 7. Troubleshooting Utilities 16 5.3.1 Java Debugger 17 5.3.2 JVM Command-Line Options 17 Common Installation and Uninstallation Problems 5.4.1 Microsoft Windows Installation Problems 5.4.2 Installing on Top of a Previous Version 18 18 19 5.5 Common User or System Administrator Problems 5.6 Known Bugs and Their Workarounds 5.7 Error Message Guide 19 19 20 5.7.1 NoClassDefFoundError 5.7.2 OutOfMemory Error 5.7.3 Other Errors 20 21 21 Key Files and Directories 22 6.1 Configuration Files 22 6.2 Directories Created at Installation 22 Installing and Configuring J2SDK, Standard Edition, v. 1.4 23 7.1 Product Distribution 7.1.1 7.2 7.3 7.4 7.5 23 International Distribution Product Licensing 23 24 7.2.1 Redistribution of Binary Product 7.2.2 Source Code License 24 25 Hardware Requirements and Dependencies 7.3.1 Platforms Supported 7.3.2 Disk Space Requirements 7.3.3 Required Boards or Peripherals 25 26 26 Software Requirements and Dependencies 7.4.1 Required Operating System Patches 7.4.2 Product Dependencies Installing J2SDK, v. 1.4 7.5.1 25 27 27 27 27 Downloading J2SDK, v, 1.4 27 Sun Microsystems, Inc. Table of Contents iv 7.5.2 Pre-Installation Considerations 7.5.3 Default Installation Path 7.5.4 Steps for Installing J2SDK, v. 1.4, and Related Downloads 7.6 Configuring J2SDK , v. 1.4 7.7 Tuning J2SDK, v. 1.4 7.8 Administering J2SDK, v. 1.4 7.8.1 7.9 28 28 29 29 30 Selecting the Default Java Platform Uninstalling J2SDK, v. 1.4 30 31 7.9.1 Pre-Uninstall Considerations 7.9.2 Steps for Uninstalling J2SDK, v. 1.4 7.9.3 8. 27 31 31 7.9.2.1 To Uninstall on the Solaris OE 7.9.2.2 To Uninstall on Microsoft Windows 7.9.2.3 To Uninstall on Linux Post-Uninstall Considerations 31 32 32 32 Reference Information 34 8.1 Product Information 34 8.2 Technical Documentation 8.3 Frequently Asked Questions 8.4 Tutorials and Other References 34 34 35 Sun Microsystems, Inc. Table of Contents v Preface This document provides support readiness information for the Java 2 Platform, Standard Edition, v. 1.4, Software Development Kit (SDK). This document is not designed to provide comprehensive product training. Instead, it focuses on issues immediately relevant to support, such as changes in this version of the product, using and troubleshooting the product, and installing and configuring the product. For pointers to other documentation, see Section 8 “Reference Information.” The information contained in this Support Readiness Document (SRD) is current at the time of printing. Since SRDs are typically prepared in advance of the First Customer Ship (FCS) date, there may be more recent or complete information available from the resources mentioned in the SRD. Sun Microsystems, Inc. Preface vii 1 Java 2 Platform, Standard Edition, v. 1.4, SDK 1.1 Overview This is the Overview SRD for the Java 2 Platorm, Standard Edition, v. 1.4, Software Developers Kit (J2SDK). The J2SDK can be used to develop programs in the Java programming language. It contains development tools, such as a bytecode compiler and debugger. A Java 2 Runtime Environment (JRE) is also provided as a separate product. The JRE contains all the components and libraries of the J2SDK that are necessary at runtime but does not contain components necessary for development. The home page for J2SE is located at: http://java.sun.com/j2se/1.4 1.2 Features, Advantages, and Benefits For a summary of new features in this release, see: http://java.sun.com/j2se/1.4/docs/relnotes/features.html This summary page contains links to more extensive documentation for many of the features. For a description of J2SDK features in general, see the documentation table of contents at: http://java.sun.com/j2se/1.4/docs/index.html The table of contents lists the functional groups with links to documentation for each piece of functionality. Sun Microsystems, Inc. 9 of 35 1.3 Introduction to J2SDK, v. 1.4 A Getting Started tutorial for the Java platform (not specifically for J2SDK, v. 1.4) entitled Your First Cup of Java is available online at: http://java.sun.com/docs/books/tutorial For new features in J2SDK, v. 1.4, as compared with prior releases of the Java platform, see: http://java.sun.com/j2se/1.4/docs/relnotes/features.html 1.4 Specialized Terminology For a glossary of Java-related terminology, see: http://java.sun.com/docs/glossary.html Sun Microsystems, Inc. 10 of 35 2 Product Changes for Version 1.4 2.1 Changes and New Features in Version 1.4 New features in J2SDK, v. 1.4, are described at: http://java.sun.com/j2se/1.4/docs/relnotes/features.html This file provides links to more extensive documentation for most new functions. See also the documentation prepared for the J2SDK, v. 1.4, Java Community Process maintenance review at: http://java.sun.com/j2se/1.4/jcp/j2se-1_4-mr_docs-spec/ 2.2 Bugs Fixed in Version 1.4 For a list of bugs fixed in J2SDK, v. 1.4, see: http://java.sun.com/j2se/1.4/fixedbugs/BugIndex.html 2.3 Previous Versions of J2SDK The best place to start is the J2SE home page located at: http://java.sun.com/j2se On the web page is a set of links to “Previous Versions” at the bottom. In addition, some previous versions are available on the archive download site located at: http://java.sun.com/products/archive/ Previous versions of the SRD for J2SE can be found at: http://access1.sun.com/SRDs/access1_srds.html Sun Microsystems, Inc. 11 of 35 2.4 Backward and Forward Compatibility With Other Versions J2SDK, v. 1.4, is backwardly compatible with previous versions of the Java 2 Platform in the vast majority of situations. Most existing software developed with previous versions of the platform will run on version 1.4. Of course, any applications developed using new APIs in version 1.4 will not work with previous versions of the platform. For descriptions of known incompatibilities in J2SDK, v. 1.4, see: http://java.sun.com/j2se/1.4/compatibility.html The javac bytecode compiler in J2SDK, v. 1.4, can be used to cross-compile to previous versions of the platform. See the description of Cross-Compilation Options on the javac documentation located at: http://java.sun.com/j2se/1.4/docs/tooldocs/solaris/ javac.html 2.5 Porting Applications to Version 1.4 In most cases, there should be no need to port applications to the new platform. For some known areas in which backwards compatibility is not maintained in J2SDK, v. 1.4, see: http://java.sun.com/j2se/1.4/compatibility.html Sun Microsystems, Inc. 12 of 35 3 Using and Supporting J2SE, V. 1.4 3.1 User’s Guides and Tutorials See the J2SE documentation located at: http://java.sun.com/j2se/1.4/docs This web page contains links to documentation for various functional areas, which, in many cases, contain tutorials, programmer’s guides, and example code. See also the online Java tutorial located at: http://java.sun.com/docs/books/tutorial The SRDs for the individual functional areas of the platform will provide URLs to any tutorials and guides that exist in those areas. Here are tutorials and programmer guides for some of the functional areas: ■ Java Plug-in: http://java.sun.com/j2se/1.4/docs/guide/plugin/ developer_guide/contents.html ■ Java Sound API Guide: http://java.sun.com/j2se/1.4/docs/guide/sound/ programmer_guide/index.html ■ RMI tutorials: http://java.sun.com/j2se/1.4/docs/guide/rmi/ ■ Security guides: http://java.sun.com/j2se/1.4/docs/guide/security/ Sun Microsystems, Inc. 13 of 35 3.2 Tools and Utilities See the documentation for tools and utilities located at: http://java.sun.com/j2se/1.4/docs/tooldocs/tools.html 3.3 Localization and Internationalization J2SDK is localized, and it does support internationalization. For information about internationalization support, see: http://java.sun.com/j2se/1.4/docs/guide/intl/ The full J2SDK documentation is translated into Japanese with a very limited portion of release documentation translated into Spanish, German, French, Swedish, Italian, Japanese, Korean, Simplified Chinese, and Traditional Chinese. Sun Microsystems, Inc. 14 of 35 4 Code Samples See the SRDs for the various functional areas of the platform for samples of code in those areas. Sun Microsystems, Inc. 15 of 35 5 Troubleshooting 5.1 Product Limitations The J2SDK can be used by developers to create applets and applications in the form of class files of Java bytecode. The bytecode is platform independent but requires a Java Virtual Machine™ (JVM™) to interpret or runtime compile the bytecode. The J2SDK cannot convert Java bytecode into platform-specific executables, such as Microsoft Windows .exe files. 5.2 Common User Questions The Java platform FAQ is located at: http://java.sun.com/products/jdk/faq.html One common question not covered separately is: Where can I get Java for platform X? Response: Sun has licensed the source code for the Java platform code to virtually every operating system and platform vendor in order to make third-party ports for other operating systems and platforms possible. Thus, Apple provides a port for the Mac OS, IBM for AIX and OS/2, Hewlett-Packard for HP-UX, and so on. Please contact the respective operating system vendor for the Java port in which you are interested or see: http://java.sun.com/cgi-bin/java-ports.cgi 5.3 Troubleshooting Utilities The SRDs for the individual functional areas provide information about the troubleshooting utilities that are particularly suited for those areas. Some general utilities and methods are listed here. Sun Microsystems, Inc. 16 of 35 5.3.1 Java Debugger For information about the Java debugger, a utility that ships as part of the SDK, see: http://java.sun.com/j2se/1.4/docs/tooldocs/tools.html 5.3.2 JVM Command-Line Options The JVM through the Java application launcher, supports many command-line options that can give useful troubleshooting diagnostics. Some examples are: ■ -verbose and -verbose:class Displays information about each class loaded. ■ -verbose:gc Reports on each garbage collection event. ■ -verbose:jni Reports information about use of native methods and other Java Native Interface™ (JNI) activity. ■ -Xdebug Starts with the debugger enabled. Refer to the Java Debugger (jdb) documentation for more details and an example: http://java.sun.com/j2se/1.4/docs/tooldocs/tools.html ■ -Xloggc:file Reports on each garbage collection event, as with -verbose:gc, but logs this data to a file. In addition to the information -verbose:gc gives, each reported event will be preceeded by the time (in seconds) since the first garbage-collection event. Always use a local file system for storage of this file to avoid stalling the JVM due to network latency. The file may be truncated in the case of a full file system and logging will continue on the truncated file. This option overrides -verbose:gc if both are given on the command line. ■ -Xprof Profiles the running program and sends profiling data to standard output. This option is provided as a utility that is useful in program development and is not intended to be used in production systems. Sun Microsystems, Inc. 17 of 35 ■ -Xrunhprof[:help][:<suboption>=<value>,...] Enables CPU, heap, or monitor profiling. This option is typically followed by a list of comma-separated <suboption>=<value> pairs. Run the command java -Xrunhprof:help to obtain a list of suboptions and their default values. ■ -Xcheck:jni Perform additional checks for JNI functions. Specifically, the JVM validates the parameters passed to the JNI function as well as the JRE data before processing the JNI request. Any invalid data encountered indicates a problem in the native code, and the JVM will terminate with a fatal error in such cases. Expect a performance degradation when this option is used. Other non-standard flags recognized by the JVM which may be useful in troubleshooting are described on this web page: http://java.sun.com/docs/hotspot/VMOptions.html The Java application launcher is further documented on the following platformspecific pages: ■ The Solaris Operating Environment (OE) http://java.sun.com/j2se/1.4/docs/tooldocs/solaris/ java.html ■ Linux http://java.sun.com/j2se/1.4/docs/tooldocs/linux/java.html ■ Microsoft Windows http://java.sun.com/j2se/1.4/docs/tooldocs/win32/java.html 5.4 Common Installation and Uninstallation Problems 5.4.1 Microsoft Windows Installation Problems Many installation problems that have been seen on Microsoft Windows platforms in the past are described in the troubleshooting section of the Microsoft Windows installation notes: http://java.sun.com/j2se/1.4/installwindows.html#troubleshooting Sun Microsystems, Inc. 18 of 35 5.4.2 Installing on Top of a Previous Version As a good practice measure to prevent unforseen problems, users should not install on top of a previous installation even though it is probable that nothing bad will happen as a result of overwriting an old installation. In the Solaris OE, J2SDK, v. 1.3, 1.3.1, and 1.4, prereleases are all installed at /usr/j2se. You can navigate there and check to see if any prior version is installed. If so, to uninstall these packages, run this command: pkgrm SUNWj3dmo SUNWj3man SUNWj3dev SUNWj3rt On Linux, J2SDK, v. 1.4, is installed in /usr/java/jdk1.4.0. If a version 1.4 prerelease is already installed, you can determine which RPM package it is by running this command: rpm -query -a | grep j2sdk-1.4.0 The output will show you which prerelease of version 1.4 is installed by its RPM package name. For example, if the prerelease version 1.4 Beta 2 is installed, the above command will show the RPM package name for Beta 2: j2sdk-1.4.0beta2. Once you have determined which package is installed, you can uninstall it by running a command such as the following: rpm -e j2sdk-1.4.0-beta2 5.5 Common User or System Administrator Problems See Section 5.7 “Error Message Guide” and Section 7.8 “Administering J2SDK, v. 1.4” below. 5.6 Known Bugs and Their Workarounds From an Overview SRD standpoint, the Release Notes provide the best summary of current known bugs in the release. See: http://java.sun.com/j2se/1.4/relnotes.html Sun Microsystems, Inc. 19 of 35 5.7 Error Message Guide 5.7.1 NoClassDefFoundError By far the most common runtime error that users write in with questions about is NoClassDefFoundError during the launch of the application. The problem is probably that the application’s class file, for example HelloWorld.class, is not on the class path. The class path is the list of one or more directories in which the Java application launcher looks for the .class files comprising your application. So, how do you get your .class files on the class path? The following example uses Microsoft Windows, but the principles apply to any platform. There is a CLASSPATH environment variable. You can see which environment variables are set on your machine by running set at the DOS prompt. If the CLASSPATH variable is set, then its value is your class path. If the CLASSPATH variable is not set, then the default class path is the current directory, which is whatever directory you run java HelloWorld from. So if you are trying to run java HelloWorld from the directory in which the HelloWorld.class file resides and you get the “can’t find” error, it is probably an indication that you have the CLASSPATH environment variable set. Try unsetting the CLASSPATH variable: set CLASSPATH= . Setting it to no value is the same as unsetting it. Then try running your application again. Because the CLASSPATH variable is not set, the class path should default to the currect directory and your application should launch. Alternatively, you could set the CLASSPATH environment variable to point to the location of your HelloWorld.class file. However, you would run into the same “can’t find” error if you then tried to run another application located in another directory. You can also force the class path to be a particular value by using the -classpath option, for example: java -classpath C:\myprograms HelloWorld Sun Microsystems, Inc. 20 of 35 5.7.2 OutOfMemory Error Another fairly common question is about OutOfMemory errors received during runtime. This can generally be fixed by increasing the maximum heap size using the -Xmx option of the java application launcher. See the following documentation: http://java.sun.com/j2se/1.4/docs/tooldocs/tools.html Users can try running their programs with the -Xverbose:gc option to see how much memory their application is using. 5.7.3 Other Errors When user questions about errors come in over general runtime email alias, they are essentially all about one or the other of the two errors described above. Other types of errors are best described in the SRDs for particular functional areas. Sun Microsystems, Inc. 21 of 35 6 Key Files and Directories 6.1 Configuration Files Users can set the security permissions of the Java 2 Platform by modifying the policy file. See: http://java.sun.com/j2se/1.4/docs/guide/security/ permissions.html 6.2 Directories Created at Installation For the Solaris OE, see: http://java.sun.com/j2se/1.4/docs/tooldocs/solaris/ jdkfiles.html For Linux, see: http://java.sun.com/j2se/1.4/docs/tooldocs/linux/ jdkfiles.html For Microsoft Windows, see: http://java.sun.com/j2se/1.4/docs/tooldocs/win32/ jdkfiles.html Sun Microsystems, Inc. 22 of 35 7 Installing and Configuring J2SDK, Standard Edition, v. 1.4 7.1 Product Distribution The product is available as a free download from the Java Software website at: http://java.sun.com/j2se/1.4 Both the J2SDK and JRE are available for download. J2SDK, v. 1.4, will eventually be on the Java JumpStart Edition CD-ROM, available from: http://www.sun.com/developers/devessentials/jumpstart.html The Java JumpStart Edition CD-ROM has a nominal cost, roughly $20 for a single copy or $50 for a yearly subscription. 7.1.1 International Distribution Here is the export control classification for the second Beta release: Java 2™ Software Development Kit, Standard Edition, (J2SE) v. 1.4, (Beta Refresh) Java™ 2 Runtime Environment, Standard Edition, (JRE) v. 1.4, (codename: Merlin) is classified under ECCN (Export Control Classification Number) 5D002. It can be exported under US Commerce Dept. License Exception ENC—Retail (sections 740.17(b)(3)) to all countries, except Afghanistan, Burma, Cuba, Iran, Iraq, Libya, North Korea, Sudan and Syria, plus all the parties listed on the Denied Parties List. Sun Microsystems, Inc. 23 of 35 The security components are classified for export control. TABLE 7-1 Security Components Component ECCN License Exception #1 CCATS2 Date3 JCE Corral 5D002 ENC-RETAIL G019791 12/22/00 SunJCE Provider 5D002 ENC-RETAIL G015491 01/25/00 JSSE (3DES/128) 5D002 ENC-RETAIL G016961 06/20/00 JAAS 5D992 NLR Selfclassified Java GSS-API Framework/Kerberos plug-in mechanism 5D992 NLR G018533 11/10/00 Digest-MD5 SASL Mechanism, StartTLS LDAP Extension, and GSSAPI SASL Mechanism 5D992 NLR G018239 11/08/00 JNDI/LDAP 1.2.2 5D992 NLR G017654 06/20/00 Java SASL 5D992 NLR G015413 01/14/00 1. CCATS is the Commerce Department’s Reference Number for commodity classification determination. 2. The date is the date it was received upon review and classification of the product by the Beureau of Export Administration. 7.2 Product Licensing The licensing overview is located at: http://www.sun.com/software/communitysource/java2/ licensing.html 7.2.1 Redistribution of Binary Product Both the J2SDK and JRE can be redistributed according to their licenses. For the details of the redistribution policy, please consult the FCS license agreements online as described in Section 7.2 “Product Licensing.” There will be no charge associated with redistributing either product. Note – It is a fairly new policy that the J2SDK is redistributable. In the past, only the JRE was redistibutable. Sun Microsystems, Inc. 24 of 35 7.2.2 Source Code License Source code will be made available through the Sun Community Source Licensing (SCSL) program. Sun’s SCSL web site is: http://www.sun.com/communitysource Portions of the source code that are under export control may not be included in the source release. 7.3 Hardware Requirements and Dependencies 7.3.1 Platforms Supported For details on system requirements and supported platforms, see the system requirements sections of the installation notes for the various platforms. For the Solaris OE: http://java.sun.com/j2se/1.4/installsolaris.html#requirements For Linux: http://java.sun.com/j2se/1.4/install-linux.html For Microsoft Windows: http://java.sun.com/j2se/1.4/installwindows.html#requirements In all cases, the platforms supported and the system requirements for the JRE are the same as those for the J2SDK. Sun Microsystems, Inc. 25 of 35 In the case of the Solaris OE, there is no minimum processor or minimum RAM. Any Solaris OE platform that can run the Solaris OE, v. 2.6 or later, is robust enough for the Java platform. TABLE 7-2 7.3.2 Processor and Memory Requirements for J2SDK 1.4.0 and JRE 1.4.0 Operating Environment Version Solaris OE 2.6 or later Linux See web site Microsoft Windows NT 4.0 service pack 5 or later, 95, 98, 2000, ME Minimum Processor Minimum RAM Recommended RAM Pentium 166 MHz 32 48 Disk Space Requirements File sizes for the various download bundles available for the J2SDK, v. 1.4, release are given on the download page and in the installation instructions for the various platforms. Disk space required to install J2SDK, v. 1.4, is about 150 MB. The files comprising the SDK use approximately 75-80 MB. 7.3.3 Required Boards or Peripherals There are no special requirements for the J2SDK, v. 1.4, release, but see the Java 2D portion of the release notes: http://java.sun.com/j2se/1.4/relnotes.html Also see the Java 2D SRD for any notes that might pertain to hardware accelerators for imaging and so on. Sun Microsystems, Inc. 26 of 35 7.4 Software Requirements and Dependencies 7.4.1 Required Operating System Patches Required patches for the Solaris OE are documented here: http://java.sun.com/j2se/1.4/install-solaris-patches.html 7.4.2 Product Dependencies For product dependency and compatibility, see the J2SDK, v. 1.4, release notes located at: http://java.sun.com/j2se/1.4/relnotes.html 7.5 Installing J2SDK, v. 1.4 7.5.1 Downloading J2SDK, v, 1.4 The current release is available for download at: http://java.sun.com/j2se/1.4 7.5.2 Pre-Installation Considerations The Solaris OE installations come in two formats. One is a self-extracting binary; the second is standard Solaris OE packages. You must be super-user to install J2SDK, v. 1.4, in the form of the Solaris OE packages. The Linux installation also comes in two format: a self-extracting binary and a standard RPM package installation. You must have root access if you intend to install the J2SDK, v. 1.4, in a system-wide location, such as /usr/local, using the self-extracting binary. You must also be root if you intend to install the Linux installation using the RPM packages. Installation of the J2SDK takes only two or three minutes. Sun Microsystems, Inc. 27 of 35 7.5.3 Default Installation Path ■ The Solaris OE: The Solaris OE J2SDK, v. 1.4, is available in two installation formats: a selfextracting binary installer and a standard Solaris OE package installation. The self-extracting binary will install into the current directory. The package installation will install by default into /usr/j2se. Note – The default installation location /usr/j2se is also the default installation location for previous releases J2SDK, v. 1.3 and 1.3.1. These previous releases should be uninstalled before installing J2SDK, v. 1.4. The JRE for the Solaris OE is available only as a self-extracting binary that installs into the current directory. ■ Linux: The Linux J2SDK is available in two installation formats: a self-extracting binary and a standard Linux RPM package installation. The self-extracting binary installs into the current directory. The RPM package installation installs J2SDK, v. 1.4, by default in /usr/java/j2sdk1.4.0. The JRE is installed at /usr/java/j2re1.4.0. ■ Microsoft Windows: The Microsoft Windows J2SDK, v. 1.4, uses an InstallShield installer that allows the user to select the installation location. The default is C:\j2sdk1.4.0. The Microsoft Windows JRE is installed by default at C:\Program Files\Javasoft\JRE\1.4. 7.5.4 Steps for Installing J2SDK, v. 1.4, and Related Downloads Installation instructions are online as follows: For the Solaris OE J2SDK: http://java.sun.com/j2se/1.4/install-solaris.html For the Solaris OE JRE: http://java.sun.com/j2se/1.4/jre/install-solaris.html For Linux J2SDK: http://java.sun.com/j2se/1.4/install-linux.html Sun Microsystems, Inc. 28 of 35 For Linux JRE: http://java.sun.com/j2se/1.4/jre/install-linux.html For Microsoft Windows J2SDK: http://java.sun.com/j2se/1.4/install-windows.html For Microsoft Windows JRE: http://java.sun.com/j2se/1.4/jre/install-windows.html For documentation: http://java.sun.com/j2se/1.4/install-docs.html 7.6 Configuring J2SDK , v. 1.4 No post-installation configuration is required. As a convenience, users will probably want to put the J2SDK’s bin directory on their PATH so that they can invoke the SDK tools without entering the full path on the command line. So, for example, if the J2SDK, v. 1.4, is installed at /home/usr/j2sdk1.4.0 on a UNIX platform, /home/usr/j2sdk1.4.0/bin could be placed on the user’s PATH. There is no need to set the CLASSPATH environment variable, and in normal circumstances it should not be set. If CLASSPATH is set, it can cause problems when trying to run applications from J2SDK. One of the most comment user questions is about getting a NoClassDefFoundError. This problem is almost always caused because the application’s class file is not on the class path. This is usually because the CLASSPATH environment variable is set. To fix the problem, just unset the CLASSPATH variable. See a related question on the FAQ: http://java.sun.com/products/jdk/faq.html#E5 When in doubt as to whether CLASSPATH should be set, do not set it. See the class path documentation referenced from the J2SDK, v. 1.4, documentation: http://java.sun.com/j2se/1.4/docs/tooldocs/tools.html 7.7 Tuning J2SDK, v. 1.4 Operation of the J2SDK and JRE can be tuned to a limited extent by the choice of command-line flags used when launching an application. Sun Microsystems, Inc. 29 of 35 J2SDK, v. 1.4, comes with two versions of the Java HotSpot™ Virtual Machine. The Java HotSpot Server VM is tuned for fast peak operating speed for longrunning server-side applications. The Java HotSpot Client VM is tuned for fast start-up time for client-side applications. These VMs can be selected at launch time by using the -server or -client options, respectively. The initial and maximum allowed memory heap size allotted to the Java runtime may be adjusted by using the -Xms and -Xmx options, respectively. See the following online documents for more information pertaining to tuning for performance: Java HotSpot VM Options: http://java.sun.com/docs/hotspot/VMOptions.html Performance FAQ: http://java.sun.com/docs/hotspot/PerformanceFAQ.html Tuning Garbage Collection: http://java.sun.com/docs/hotspot/gc/index.html The last document on Tuning Garbage Collection was written primarily for users of J2SDK, v. 1.3.1, but much of it pertains to J2SDK, v. 1.4, as well. 7.8 Administering J2SDK, v. 1.4 The following pertains to the Solaris OE and may be of interest to system administrators. 7.8.1 Selecting the Default Java Platform The /usr/java symbolic link is used to define the default Java environment on a Solaris OE when more than one Java environment is installed. Currently, JDK, v. 1.1, is installed in /usr/java1.1, J2SDK, v. 1.2.2, is installed in /usr/ java1.2, and J2SDK, v. 1.3, J2SDK, v. 1.3.1, and J2SDK, v. 1.4, are installed by default in /usr/j2se and will overwrite each other. Prior to the Solaris OE, v. 8 release, the /usr/java symbolic link pointed to /usr/java1.1 if both JDK, v. 1.1, and J2SDK, v. 1.2.2, were installed, making JDK, v. 1.1, the default Java platform. Starting with the Solaris OE, v. 8 release, the /usr/java symbolic link points to /usr/java1.2 by default. If both JDK, v. 1.1, and J2SDK, v. 1.2.2, are installed, J2SDK, v. 1.2.2, will be the default Java platform. Sun Microsystems, Inc. 30 of 35 Because there are symbolic links in /usr/bin (also known as /bin) that use /usr/java (for example, /usr/bin/java refers to /usr/java/bin/java), this /usr/java link can change the default Java installation seen by most users. Many Java applications run on any of J2SDK, v. 1.4, J2SDK, v. 1.3.1, J2SDK, v. 1.2.2, or JDK, v. 1.1, but users and applications might want to be selective about which Java installation they use. If you want to use JDK, v. 1.1, /usr/java1.1/bin should be on your PATH before /usr/bin. If you want to use J2SDK, v. 1.4, /usr/j2se/bin should be on your PATH before /usr/bin. It is possible for root users to make J2SDK, v. 1.4, the default Java platform by modifying the /usr/java symbolic link to point to /usr/j2se. However, changing the symbolic link in this manner may cause problems for some Java applications that are expecting to use earlier versions of the Java platform. See the online compatibility documentation for information about incompatibilities between J2SDK, v. 1.4, and earlier releases: http://java.sun.com/j2se/1.4/compatibility.html 7.9 Uninstalling J2SDK, v. 1.4 7.9.1 Pre-Uninstall Considerations The J2SDK, v. 1.4, can be uninstalled in two or three minutes. 7.9.2 Steps for Uninstalling J2SDK, v. 1.4 7.9.2.1 To Uninstall on the Solaris OE If the installation was done with the Solaris OE packages, use the pkgrm command: pkgrm SUNWj3dmo SUNWj3man SUNWj3dev SUNWj3rt If the Solaris OE installation was done using the self-extracting binary, you must manually delete installed files. Sun Microsystems, Inc. 31 of 35 7.9.2.2 To Uninstall on Microsoft Windows Go to the Microsoft Windows control panel (Start --> Settings --> Control Panel) and select the Add/Remove Programs control panel. There will be an item there for J2SDK, v. 1.4, which you can select for uninstallation. 7.9.2.3 To Uninstall on Linux If you used the RPM package installation to install the J2SDK, use this command to uninstall it: rpm -e j2sdk-1.4.0 To uninstall the JRE, use this command rpm -e j2re-1.4.0 If you installed the J2SDK or JRE using the the self-extracting binary, you must manually delete the files. 7.9.3 Post-Uninstall Considerations The following information pertains to the uninstall of the Microsoft Windows version of the Beta release. The problem described here may not exist in the final release. During installation, the following files are copied into the Netscape browser plugin directories: NPJava11.dll NPJava12.dll NPJava131.dll NPJava32.dll NPOJI600.dll However, during uninstallation they may not be removed. Therefore, after an uninstall, a subsequent attempt to reinstall J2SE, v. 1.4, may result in the following error message: Cannot install Java Plug-in for Netscape Navigator in %s It may be caused by the following reasons: Previous version of Java Plug-in is running, please close the browser. Netscape Navigator has been removed from this location. The drive or the file is read-only. Sun Microsystems, Inc. 32 of 35 If you see such a message, manually delete the five files mentioned above and then try the reinstall again. Sun Microsystems, Inc. 33 of 35 8 Reference Information 8.1 Product Information ■ Java 2 Platform, Standard Edition, Home Page: http://java.sun.com/j2se 8.2 Technical Documentation ■ J2SDK Documentation Guide: http://java.sun.com/j2se/1.4/docs ■ API Guide on Java 2 Platform: http://java.sun.com/j2se/1.4/docs/api ■ Java 2 Platform, Standard Edition docs: http://java.sun.com/docs/index.html ■ Performance Documentation for the Java HotSpot virtual machine: http://java.sun.com/docs/hotspot/index.html 8.3 Frequently Asked Questions ■ Principal FAQ: http://java.sun.com/products/jdk/faq.html ■ Performance FAQ: http://java.sun.com/docs/hotspot/PerformanceFAQ.html ■ FAQ Index: http://java.sun.com/docs/faqindex.html Sun Microsystems, Inc. 34 of 35 8.4 Tutorials and Other References ■ Java Tutorial on Java 2 Platform: http://java.sun.com/docs/books/tutorial ■ JDC tutorials: http://developer.java.sun.com/developer/onlineTraining/ ■ White papers: http://java.sun.com/docs/white/index.html ■ JDC documentation site: http://developer.java.sun.com/developer/infodocs/ ■ JDC technical tips: http://developer.java.sun.com/developer/JDCTechTips/ Sun Microsystems, Inc. 35 of 35