Before using this information and the product it supports, read the information in Notices.
This edition of the user guide applies to the IBM 64-bit SDK for AIX, Java 2 Technology Edition, Version 5.0, and to all subsequent releases, modifications, and Service Refreshes, until otherwise indicated in new editions.
© Copyright Sun Microsystems, Inc. 1997, 2004, 901 San Antonio Rd., Palo Alto, CA 94303 USA. All rights reserved.
This user guide provides general information about the IBM® 64-bit SDK for AIX®, Java™ 2 Technology Edition, Version 5.0. The user guide gives specific information about any differences in the IBM implementation compared with the Sun implementation.
Read this user guide with the more extensive documentation on the Sun Web site: http://java.sun.com.
The software that is contained in this release can be used only on AIX Version 5.2 or later. It is not supported, and does not work, on earlier versions of the AIX operating system. See AIX Environment for further details of requirements on the AIX operating system for this release.
Useful Web sites include:
The Diagnostics Guide provides more detailed information about the IBM Virtual Machine for Java.
This user guide is part of a release and is applicable only to that particular release. Make sure that you have the user guide appropriate to the release you are using.
The terms "Runtime Environment" and "Java Virtual Machine" are used interchangeably throughout this user guide.
Technical changes made for this version of the user guide, other than minor or obvious ones, are indicated by blue chevrons when viewing in an Information Center, by blue chevrons and in red when viewing in HTML, or by vertical bars to the left of the changes when viewing as a PDF file.
The Program Code is not designed or intended for use in real-time applications such as (but not limited to) the online control of aircraft, air traffic, aircraft navigation, or aircraft communications; or in the design, construction, operation, or maintenance of any nuclear facility.
The IBM SDK is a development environment for writing and running applets and applications that conform to the Java 5.0 Core Application Program Interface (API).
In general, any applet or application that ran with a previous version of the SDK should run correctly with the IBM 64-bit SDK for AIX, v5.0. Classes compiled with this release are not guaranteed to work on previous releases.
For information about compatibility issues between releases, see the Sun Web site at:
http://java.sun.com/j2se/5.0/compatibility.html
http://java.sun.com/j2se/1.4/compatibility.html
http://java.sun.com/j2se/1.3/compatibility.html
If you are using the SDK as part of another product (for example, IBM WebSphere® Application Server), and you upgrade from a previous level of the SDK, perhaps v1.4.2, serialized classes might not be compatible. However, classes are compatible between service refreshes.
From Version 5.0, the IBM Runtime Environment for AIX contains a new version of the IBM Virtual Machine for Java and the Just-In-Time (JIT) compiler.
If you are migrating from an older IBM Runtime Environment, note that:
The IBM 64-bit SDK for AIX, v5.0 runs on AIX v5.2 Recommended Maintenance Package AIX 5200-07 or later, or AIX v5.3 Recommended Maintenance Package AIX 5300-03 or later.
The latest service details and resources can be found here:http://www.ibm.com/developerworks/java/jdk/aix/service.html
To test whether this Java v5.0 SDK is supported on a specific System p® system, at the system prompt type:
lscfg -p | fgrep Architecture
Supported platforms reply as follows:
Model Architecture: chrp
Only "Common Hardware Reference Platform" (CHRP) systems are supported by this SDK.
The environment variable LDR_CNTRL=MAXDATA is not supported for 64-bit processes. Only use LDR_CNTRL=MAXDATA on 32-bit processes.
If you are using one of the supported non-UTF8 CJK locales, you must install one of the following file sets.
X11.fnt.ucs.ttf (for ja_JP or Ja_JP) X11.fnt.ucs.ttf_CN (for zh_CN or Zh_CN) X11.fnt.ucs.ttf_KR (for ko_KR) X11.fnt.ucs.ttf_TW (for zh_TW or Zh_TW)
The SDK contains several development tools and a Java Runtime Environment (JRE). This section describes the contents of the SDK tools and the Runtime Environment.
Applications written entirely in Java must have no dependencies on the IBM SDK's directory structure (or files in those directories). Any dependency on the SDK's directory structure (or the files in those directories) might result in application portability problems.
The documentation package is designed to be extracted into the SDK software installation directory. If you download the compressed version, be sure to preserve the path names when you extract the files from the archive.
A list of classes, tools, and other files that you can use with the standard Runtime Environment.
A list of tools and reference information that is included with the standard SDK.
The License file, /usr/swlag/<locale>/Java5_64.la, contains the license agreement for the SDK for AIX software (where <locale> is the name of your locale, for example en). To view or print the license agreement, open the file in a Web browser.
The IBM 64-bit SDK for AIX, v5.0 complete release consists of several installp image files (packages). Each installp image file or package contains one or more related filesets. You can install the packages using the smit or smitty system management tools. Alternatively, you can use the installp command.
This package is required:
These packages are optional:
$LANG is one of the following locales. These packages do not include any files but pull in required Unicode TrueType fonts, if not already installed, for these locales:
The SDK is installed in the directory:
/usr/java5_64/
The following user-configurable files are installed to /etc/java5_64/ to support a configuration where the files are not shared:
There are symbolic links in /usr/java5_64/ pointing to the files in /etc/java5_64/.
By default, the SDK is installed in /usr/java5_64/. To install the SDK in another directory, use the AIX relocation commands. This feature is supported from IBM SDK for Java Version 5, SR 7 onwards.
Delete any .toc files in the directory containing your installp images or PTFs before using the AIX relocation commands.
See the AIX man pages for more information about the command-line options for these commands.
installp_r -a -Y -R /<Install Path>/ -d '.' Java5_64.sdkRemove the SDK:
installp_r -u -R /<Install Path>/ Java5_64.sdk
lsusil
lslpp_r -R /<Install Path>/ -S [A|O]
rmusil -R /<Install Path>/
If you are upgrading the SDK from a previous release, back up all the configuration files and security policy files before you start the upgrade.
After the upgrade, you might have to restore or reconfigure these files because they might have been overwritten during the upgrade process. Check the syntax of the new files before restoring the original files because the format or options for the files might have changed.
To help ensure that the verification process behaves consistently, first:
unset LIBPATH unset CLASSPATH unset JAVA_COMPILER unset JAVA_HOME export PATH=/usr/java5_64/jre/bin:/usr/java5_64/bin:$PATH
When you issue the command:
java -version
you see output like the following messages:
java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build pap64dev-20051104)
where dates, times, and specific build numbers might be different.
When verification is complete, log on again and review for possible conflicts arising from values that you assigned to these variables.
If you alter the PATH environment variable, you will override any existing Java launchers in your path.
The PATH environment variable enables AIX to find programs and utilities, such as javac, java, and javadoc tool, from any current directory. To display the current value of your PATH, type the following at a command prompt:
echo $PATH
To add the Java launchers to your path:
export PATH=/usr/java5_64/bin:/usr/java5_64/jre/bin:$PATH
After setting the path, you can run a tool by typing its name at a command prompt from any directory. For example, to compile the file Myfile.Java, at a command prompt, type:
javac Myfile.Java
The class path tells the SDK tools, such as java, javac, and the javadoc tool, where to find the Java class libraries.
You should set the class path explicitly only if:
To display the current value of your CLASSPATH environment variable, type the following command at a shell prompt:
echo $CLASSPATH
If you develop and run applications that use different runtime environments, including other versions that you have installed separately, you must set the CLASSPATH and PATH explicitly for each application. If you run multiple applications simultaneously and use different runtime environments, each application must run in its own shell prompt.
You can apply recent changes to daylight saving time using the IBM Time Zone Update Utility for Java (JTZU).
Many countries around the world use a daylight saving time (DST) convention. Typically, clocks move forward by one hour during the summer months to create more daylight hours during the afternoon and less during the morning. This practice has many implications, including the need to adjust system clocks in computer systems. Occasionally, countries change their DST start and end dates. These changes can affect the date and time functions in applications, because the original start and end dates are programmed into the operating system and in Java software. To avoid this problem you must update operating systems and Java installations with the new DST information.
The Olson time zone database is an external resource that compiles information about the time zones around the world. This database establishes standard names for time zones, such as "America/New_York", and provides regular updates to time zone information that can be used as reference data. To ensure that Java JREs and SDKs contain up to date DST information, IBM incorporates the latest Olson update into each Java service refresh. To find out which Olson time zone update is included for a particular service refresh, see https://www.ibm.com/developerworks/java/jdk/dst/olson_table.html.
If a DST change has been introduced since the last service refresh, you can use JTZU to directly update your Java installation. You can also use this tool to update your installation if you are unable to move straight to the latest service refresh. JTZU is available from IBM developerWorks® using the following link: https://www.ibm.com/developerworks/java/jdk/dst/jtzu.html.
After updating your Java installation with any recent DST changes, your application can handle time and date calculations correctly.
Java applications can be started using the java launcher or through JNI. Settings are passed to a Java application using command-line arguments, environment variables, and properties files.
An overview of the java and javaw commands.
The java and javaw tools start a Java application by starting a Java Runtime Environment and loading a specified class.
The javaw command is identical to java, except that javaw has no associated console window. Use javaw when you do not want a command prompt window to be displayed. The javaw launcher displays a window with error information if it fails.
The JVM searches for the initial class (and other classes that are used) in three sets of locations: the bootstrap class path, the installed extensions, and the user class path. The arguments that you specify after the class name or jar file name are passed to the main function.
The java and javaw commands have the following syntax:
java [ options ] <class> [ arguments ... ] java [ options ] -jar <file.jar> [ arguments ... ] javaw [ options ] <class> [ arguments ... ] javaw [ options ] -jar <file.jar> [ arguments ... ]
You obtain The IBM build and version number for your Java installation using the -version option.
java -versionYou will see information similar to:
java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build pxi32dev-20051104) IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 Linux x86-32 j9vmxi3223-20051103 (JIT enabled) J9VM - 20051027_03723_lHdSMR JIT - 20051027_1437_r8 GC - 20051020_AA) JCL - 20051102Exact build dates and versions will change.
You can specify Java options and system properties on the command line, by using an options file, or by using an environment variable.
These methods of specifying Java options are listed in order of precedence. Rightmost options on the command line have precedence over leftmost options; for example, if you specify:
java -Xint -Xjit myClass
The -Xjit option takes precedence.
java -Dmysysprop1=tcpip -Dmysysprop2=wait -Xdisablejavadump MyJavaClass
export IBM_JAVA_OPTIONS="-Dmysysprop1=tcpip -Dmysysprop2=wait -Xdisablejavadump"
The definitions for the standard options.
See JVM command-line options for information about nonstandard (-X) options.
The java and javaw launchers accept arguments and class names containing any character that is in the character set of the current locale. You can also specify any Unicode character in the class name and arguments by using Java escape sequences.
To do this, use the -Xargencoding command-line option.
For example, to specify a class called HelloWorld using Unicode encoding for both capital letters, use this command:
java -Xargencoding '\u0048ello\u0057orld'
The java and javaw commands provide translated messages. These messages differ based on the locale in which Java is running. The detailed error descriptions and other debug information that is returned by java is in English.
The LIBPATH environment variable tells AIX applications, such as the JVM, where to find shared libraries when they are located in a different directory from the directory that is specified in the header section of the program.
For example, the header section of the java command is as follows:
> dump -X64 -H /usr/java5_64/jre/bin/java /usr/java5_64/jre/bin/java: ***Loader Section*** Loader Header Information VERSION# #SYMtableENT #RELOCent LENidSTR 0x00000001 0x0000003f 0x0000006d 0x00000090 #IMPfilID OFFidSTR LENstrTBL OFFstrTBL 0x00000006 0x00000b24 0x00000099 0x00000bb4 ***Import File Strings*** INDEX PATH BASE MEMBER 0 /usr/lib:/lib 1 libc.a shr.o 2 libC.a shr.o 3 libpthreads.a shr_comm.o 4 libpthreads.a shr_xpg5.o 5 libbsd.a shr.o
Index 0 (in bold above) contains the list of directories that are searched for shared objects if LIBPATH is not specified. If LIBPATH is set, the specified directories are searched for shared objects before those listed in Index 0 of the header.
The shared libraries for the SDK are in /usr/java5_64/jre/bin/ and /usr/java5_64/jre/bin/j9vm. The SDK's Java launcher programs (for example, java, javac, jar) automatically search these directories. If Java is installed as an AIX file set, the parent directory is /usr/java5_64/, but packages that bundle Java might use different directories. This path is already set by the Java launcher programs such as java, javac, or jar.
Set the LIBPATH if either of the following conditions applies:
The POWER4™ and later PowerPC® processors support the use of 16 MB large pages in addition to the default 4 KB pages. The POWER5+™ and later PowerPC processors add support for two new page sizes, 64 KB and 16 GB.
AIX v5.2 and later operating systems support 16 MB pages. AIX v5.3 maintenance package 5300-04 on POWER5+ processors adds support for the 64 KB and 16 GB page sizes. The 16 MB and 16 GB pages require AIX system configuration changes. For information on using 16 MB pages with AIX, see http://www.ibm.com/servers/aix/whitepapers/large_page.html. For information about using either 64 KB or 16 GB pages with AIX, see http://www.ibm.com/servers/aix/whitepapers/multiple_page.pdf. The default AIX page size is 4 KB.
The LDR_CNTRL=LARGE_PAGE_DATA environment variable can be used under the AIX v5.2 and later operating systems to control the use of 16 MB pages for the native data area and native heap of a program. You can use 16 MB large pages, if they are available, by setting LDR_CNTRL=LARGE_PAGE_DATA=Y. Using large pages might improve the performance of Java applications that require a large amount of native heap space. In particular, the native heap is used for machine code generated by the just-in-time compiler and Java applications with a large number of compiled methods might benefit from using 16 MB pages for the native heap.
AIX v5.3 maintenance package 5300-04 added LDR_CNTRL variants that independently control the use of different page sizes for the text (TEXTPSIZE), stack (STACKPSIZE) and native data or heap (DATAPSIZE) areas. See the Guide to Multiple Page Size Support on AIX 5L™ Version 5.3 for general information about these variants: http://www.ibm.com/servers/aix/whitepapers/multiple_page.pdf.
An example of the use of TEXTPSIZE, STACKPSIZE, and DATAPSIZE variants is:
LDR_CNTRL=TEXTPSIZE=4K@STACKPSIZE=64K@DATAPSIZE=64K
This example uses 4 KB pages for text, 64 KB pages for stack and 64 KB pages for the native data and native heap areas. A DATAPSIZE setting will override any LARGE_PAGE_DATA setting.
The new 64 KB pages are general-purpose and most workloads will see a benefit by using 64 KB pages for text, stack, native data, and the Java heap. The 16 GB pages are intended only for use in very high performance environments.
For more information about using the LDR_CNTRL environment variables and on configuring AIX support for large pages, see http://www.ibm.com/servers/aix/whitepapers/large_page.html for AIX v5.2 information on 16 MB pages, and http://www.ibm.com/servers/aix/whitepapers/multiple_page.pdf for information on AIX v5.3 support of 64 KB and 16 GB pages.
The IBM Just-In-Time (JIT) compiler dynamically generates machine code for frequently used bytecode sequences in Java applications and applets during their execution. The JIT v5.0 compiler delivers new optimizations as a result of compiler research, improves optimizations implemented in previous versions of the JIT, and provides better hardware exploitation.
The JIT is included in both the IBM SDK and Runtime Environment, which is enabled by default in user applications and SDK tools. Typically, you do not start the JIT explicitly; the compilation of Java bytecode to machine code occurs transparently. You can disable the JIT to help isolate a problem. If a problem occurs when executing a Java application or an applet, you can disable the JIT to help isolate the problem. Disabling the JIT is a temporary measure only; the JIT is required to optimize performance.
The Stack Execution Disable (SED) feature in the AIX 5300-03 Recommended Maintenance package stops code from executing in data areas (Power4 and later). For more information about this feature and how it affects the SDK, see AIX Stack Execution Disable.
For more information about the JIT, see the Diagnostics Guide.
The JIT can be disabled in a number of different ways. Both command-line options override the JAVA_COMPILER environment variable.
Turning off the JIT is a temporary measure that can help isolate problems when debugging Java applications.
export JAVA_COMPILER=NONE
java -Djava.compiler=NONE <class>
java -Xint <class>
The JIT is enabled by default. You can explicitly enable the JIT in a number of different ways. Both command-line options override the JAVA_COMPILER environment variable.
export JAVA_COMPILER=jitcIf the JAVA_COMPILER environment variable is an empty string, the JIT remains disabled. To disable the environment variable, at the prompt, enter:
unset JAVA_COMPILER
java -Djava.compiler=jitc <class>
java -Xjit <class>
You can determine the status of the JIT using the -version option.
Run the java launcher with the -version option. Enter the following at a shell prompt:
java -version
If
the JIT is not in use, a message is displayed that includes the following:
(JIT disabled)
If
the JIT is in use, a message is displayed that includes the following:
(JIT enabled)
For more information about the JIT, see the Diagnostics Guide.
The Garbage Collector manages the memory used by Java and by applications running in the JVM.
When the Garbage Collector receives a request for storage, unused memory in the heap is set aside in a process called "allocation". The Garbage Collector also checks for areas of memory that are no longer referenced, and releases them for reuse. This is known as "collection".
The collection phase can be triggered by a memory allocation fault, which occurs when no space is left for a storage request, or by an explicit System.gc() call.
Garbage collection can significantly affect application performance, so the IBM virtual machine provides various methods of optimizing the way garbage collection is carried out, potentially reducing the effect on your application.
For more detailed information about garbage collection, see the Diagnostics Guide.
The -Xgcpolicy options control the behavior of the Garbage Collector. They make trade-offs between throughput of the application and overall system, and the pause times that are caused by garbage collection.
The format of the option and its values is:
When an application's attempt to create an object cannot be satisfied immediately from the available space in the heap, the Garbage Collector is responsible for identifying unreferenced objects (garbage), deleting them, and returning the heap to a state in which the immediate and subsequent allocation requests can be satisfied quickly.
Such garbage collection cycles introduce occasional unexpected pauses in the execution of application code. Because applications grow in size and complexity, and heaps become correspondingly larger, this garbage collection pause time tends to grow in size and significance.
The default garbage collection value, -Xgcpolicy:optthruput, delivers very high throughput to applications, but at the cost of these occasional pauses, which can vary from a few milliseconds to many seconds, depending on the size of the heap and the quantity of garbage.
The subpool option of -Xgcpolicy provides additional throughput optimization for large SMP systems (24- to 64-way).
The JVM uses two techniques to reduce pause times: concurrent garbage collection and generational garbage collection.
The -Xgcpolicy:optavgpause command-line option requests the use of concurrent garbage collection to reduce significantly the time that is spent in garbage collection pauses. Concurrent GC reduces the pause time by performing some garbage collection activities concurrently with normal program execution to minimize the disruption caused by the collection of the heap. The -Xgcpolicy:optavgpause option also limits the effect of increasing the heap size on the length of the garbage collection pause. The -Xgcpolicy:optavgpause option is most useful for configurations that have large heaps. With the reduced pause time, you might experience some reduction of throughput to your applications.
During concurrent garbage collection, a significant amount of time is wasted identifying relatively long-lasting objects that cannot then be collected. If garbage collection concentrates on only the objects that are most likely to be recyclable, you can further reduce pause times for some applications. Generational GC reduces pause times by dividing the heap into two generations: the "new" and the "tenure" areas. Objects are placed in one of these areas depending on their age. The new area is the smaller of the two and contains new objects; the tenure is larger and contains older objects. Objects are first allocated to the new area; if they have active references for long enough, they are promoted to the tenure area.
Generational GC depends on most objects not lasting long. Generational GC reduces pause times by concentrating the effort to reclaim storage on the new area because it has the most recyclable space. Rather than occasional but lengthy pause times to collect the entire heap, the new area is collected more frequently and, if the new area is small enough, pause times are comparatively short. However, generational GC has the drawback that, over time, the tenure area might become full. To minimize the pause time when this situation occurs, use a combination of concurrent GC and generational GC. The -Xgcpolicy:gencon option requests the combined use of concurrent and generational GC to help minimize the time that is spent in any garbage collection pause.
If the Java heap becomes nearly full, and very little garbage can be reclaimed, requests for new objects might not be satisfied quickly because no space is immediately available.
If the heap is operated at near-full capacity, application performance might suffer regardless of which garbage collection options are used; and, if requests for more heap space continue to be made, the application might receive an OutOfMemoryError, which results in JVM termination if the exception is not caught and handled. At this point, the JVM produces a Javadump file for use during diagnostics. In these conditions, you are recommended either to increase the heap size by using the -Xmx option or to reduce the number of objects in use.
For more information, see the Diagnostics Guide.
System resources, for instance memory and CPUs, can be dynamically added to or removed from a logical partition (LPAR) running AIX. Java applications can take advantage of any new resources. Java applications can also respond to DLPAR events using extensions to the java.lang.management API.
If you run Java applications on a single CPU LPAR and never dynamically add a CPU to that LPAR while those Java applications are running, you can improve the performance (results vary depending on the execution characteristics of your application) by exporting the following environment variable: export NO_LPAR_RECONFIGURATION=1. Do not export this environment variable unless you can guarantee all of the following:
Resource changes are effective immediately, so AIX does not have to be rebooted. If an administrator decreases the number of CPUs or memory allocated to an LPAR, the performance of any running SDK application might degrade.
For more information, see http://www.ibm.com/servers/eserver/pseries/hardware/whitepapers/dlpar.html and the article: Dynamic reconfiguration: Basic building blocks for autonomic computing on IBM pSeries® servers in the following IBM Systems Journal issue: http://www.research.ibm.com/journal/sj42-1.html.
To enable applications to respond to DLPAR events, the Java v5.0 SDK includes IBM-specific extensions to java.lang.management that provide a Java interface to query various LPAR-specific information and listen for events indicating that the JVM's logical partition has been dynamically altered. The Javadoc tool for this API is provided with the SDK in the file docs/apidoc.zip.
The launcher option, -Xsoftmx, is also available with the Java 6 SDK. The -Xmx option specifies the maximum size (hard limit) of the Java heap. The -Xsoftmx option specifies a lower initial maximum heap size (a "soft" limit). You can change the value of -Xsoftmx at runtime using the java.lang.management API. The valid range of values is between the minimum heap size (-Xms) and the hard limit (-Xmx).
For example, if the JVM is running in an LPAR with 2 GB of memory available for the heap, but the amount of memory might be changed to as low as 1 GB or as high as 8 GB during the run, a suitable set of command-line options might be:
-Xms1g -Xsoftmx2g -Xmx8g
The value of -Xms must be less than or equal the value of -Xsoftmx. If unspecified, -Xsoftmx defaults to the value of -Xmx.
IBM AIX Workload Partitions (WPARs) are software-created, virtualized operating system environments in a single instance of the AIX operating system. To most applications, the workload partition appears to be a separate instance of AIX. Applications in workload partitions have a private execution environment.
Applications in workload partitions are isolated in terms of process and signal, and can be isolated in file system space. Workload partitions can have their own unique users and groups. Workload partitions have dedicated network addresses and interprocess communication (IPC) is restricted to processes running in the same workload partition.
There are two forms of workload partitions:
You can configure either WPAR type for mobility, which allows you to move running WPAR instances between physical systems using the AIX Workload Manager.
From Version 5.0 Service Refresh 8, the IBM SDK for Java supports WPAR mobility. The IBM SDK for Java can also respond to WPAR mobility events and use system environment changes in the same way as when a DLPAR is reconfigured. See Dynamic Logical Partitioning (DLPAR) support for more information.
For more information about WPAR, see http://www.ibm.com/servers/eserver/pseries/hardware/whitepapers/dlpar.html.
The IBM 64-bit SDK for AIX, v5.0 uses the IPv6 extensions to the TCP/IP protocol by default.
On AIX v5.2, if your application uses multicast sockets or your application explicitly uses IPv6 format address, you must enable the network interfaces on your workstation to handle IPv6 addresses. The network interfaces can be configured for IPv6 with smitty or by using the autoconf6 or ifconfig commands.
If you do not want to use IPv6 protocols, you can set the property java.net.preferIPv4Stack to force the use of IPv4 protocols.
The IBM SDK includes enhanced BiDirectional support.
For more information, see http://www.ibm.com/developerworks/java/jdk/additional/JAVABIDI.html.
The Javadoc file for the BiDirectional package is provided with the SDK in the docs/apidoc.zip file.
The IBM SDK and Runtime Environment set the Euro as the default currency for those countries in the European Monetary Union (EMU) for dates on or after 1 January, 2002. From 1 January 2008, Cyprus and Malta also have the Euro as the default currency.
To use the old national currency, specify -Duser.variant=PREEURO on the Java command line.
If you are running the UK, Danish, or Swedish locales and want to use the Euro, specify -Duser.variant=EURO on the Java command line.
From Service Refresh 5, the following new locale is added: Serbia (SE), with three new locale variations.
The locale variations are:
The existing locale variations for the former Serbia and Montenegro are maintained as before. The 3-letter country code SRB, corresponding to the 2-letter country code RC, is also added.
To increase the maximum number of threads your system can support, lower the maximum native stack size using the -Xss<size> option.
The default native stack size is 1024 KB. A smaller setting allows for a larger number of threads. For example:
java -Xss<size> <other params>
To increase the maximum number of file descriptors your system can support, use the ulimit or chuser commands, for example:
ulimit -n 3000
or
chuser nofiles=3000 <user_id>
Use ulimit -a to show the current limit.
AIX 5300-03 implements Buffer Overflow Protection (BOP) using Stack/heap Execution Disable (SED). SED prevents buffer overflow attacks by not executing code in data areas of memory. AIX system administrators control the way SED is used. Java JIT implementations generate machine code in C heap memory; therefore, Java launchers must be exempt from SED.
You make programs exempt from SED by setting the XCOFF executable file header flag DEP_EXEMPT. All Java launchers have the appropriate bit set to exempt them from the SED feature.
Applications that use their own Java launchers and create JVM instances using JNI must be explicitly patched to exempt them from SED. Use the sedmgr utility and verify the change using the dump or sedmgr utility.
The syntax for using these utilities is:
sedmgr -c exempt <launcher> dump -X64 -ov <launcher>
For more details on SED, see http://publib.boulder.ibm.com/infocenter/pseries/index.jsp.
The SDK for AIX contains many tools and libraries required for Java software development.
See Contents of the SDK for details of the tools available.
The IBM SDK contains the XSLT4J processor and the XML4J parser. With these tools, you can parse and transform XML documents independently from any given XML processing implementation. By using "Factory Finders" to locate the SAXParserFactory, DocumentBuilderFactory and TransformerFactory implementations, your application can swap between different implementations without having to change any code.
The IBM SDK contains the XSLT4J processor and the XML4J parser that conform to the JAXP 1.3 specification.
The XML technology included with the IBM SDK is similar to Apache Xerces Java and Apache Xalan Java. See http://xml.apache.org/xerces2-j/ and http://xml.apache.org/xalan-j/ for more information.
With the XSLT4J processor, you choose between the original XSLT Interpretive processor and the XSLT Compiling processor. The Interpretive processor is for tooling and debugging environments and supports the XSLT extension functions that are not supported by the XSLT Compiling processor. The XSLT Compiling processor is for high performance runtime environments; it generates a transformation engine, or translet, from an XSL style sheet. This approach separates the interpretation of stylesheet instructions from their runtime application to XML data.
The XSLT Interpretive processor is the default processor. To use the XSLT Compiling processor:
To implement properties in the jaxp.properties file, copy jaxp.properties.sample to jaxp.properties in /etc/java5_64/jre/lib and create a symbolic link to this file from the /usr/java5_64/jre/lib directory. This file also contains full details about the procedure used to determine which implementations to use for the TransformerFactory, SAXParserFactory, and the DocumentBuilderFactory.
To improve the performance when you transform a StreamSource object with the XSLT Compiling processor, specify the com.ibm.xslt4j.b2b2dtm.XSLTCB2BDTMManager class as the provider of the service org.apache.xalan.xsltc.dom.XSLTCDTMManager. To determine the service provider, try each step until you find org.apache.xalan.xsltc.dom.XSLTCDTMManager:
The XSLT Compiling processor detects the service provider for the org.apache.xalan.xsltc.dom.XSLTCDTMManager service when a javax.xml.transform.TransformerFactory object is created. Any javax.xml.transform.Transformer or javax.xml.transform.sax.TransformerHandler objects that are created by using that TransformerFactory object use the same service provider. You can change service providers by modifying one of the settings described above and then creating a new TransformerFactory object.
If you are using an older version of Xerces (before 2.0) or Xalan (before 2.3) in the endorsed override, you might get a NullPointerException when you start your application. This exception occurs because these older versions do not handle the jaxp.properties file correctly.
To avoid this situation, use one of the following workarounds:
export IBM_JAVA_OPTIONS=-Djavax.xml.parsers.SAXParserFactory= org.apache.xerces.jaxp.SAXParserFactoryImplor
export IBM_JAVA_OPTIONS=-Djavax.xml.parsers.DocumentBuilderFactory= org.apache.xerces.jaxp.DocumentBuilderFactoryImplor
export IBM_JAVA_OPTIONS=-Djavax.xml.transform.TransformerFactory= org.apache.xalan.processor.TransformerFactoryImpl
To debug Java programs, you can use the Java Debugger (JDB) application or other debuggers that communicate by using the Java Platform Debugger Architecture (JPDA) that is provided by the SDK for the operating system.
The SDK includes a Plug-in for the AIX debugger DBX. Although the DBX Plug-in is supplied as part of the SDK, it is not supported. However, IBM will accept bug reports.
More information about problem diagnosis using Java can be found in the Diagnostics Guide.
The Java Debugger (JDB) is included in the SDK for AIX. The debugger is started with the jdb command; it attaches to the JVM using JPDA.
To debug a Java application:
java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=<port> <class>The JVM starts up, but suspends execution before it starts the Java application.
jdb -attach <port>The debugger will attach to the JVM, and you can now issue a range of commands to examine and control the Java application; for example, type run to allow the Java application to start.
For more information about JDB options, type:
jdb -help
For more information about JDB commands:
You can also use JDB to debug Java applications running on remote workstations. JPDA uses a TCP/IP socket to connect to the remote JVM.
java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=<port> <class>The JVM starts up, but suspends execution before it starts the Java application.
jdb -attach <host>:<port>
The Java Virtual Machine Debugging Interface (JVMDI) is not supported in this release. It has been replaced by the Java Virtual Machine Tool Interface (JVMTI).
For more information about JDB and JPDA and their usage, see these Web sites:
Some Java applications must be able to determine whether they are running on a 32-bit JVM or on a 64-bit JVM. For example, if your application has a native code library, the library must be compiled separately in 32- and 64-bit forms for platforms that support both 32- and 64-bit modes of operation. In this case, your application must load the correct library at runtime, because it is not possible to mix 32- and 64-bit code.
The system property com.ibm.vm.bitmode allows applications to determine the mode in which your JVM is running. It returns the following values:
You can inspect the com.ibm.vm.bitmode property from inside your application code using the call:
System.getProperty("com.ibm.vm.bitmode");
When a signal is raised that is of interest to the JVM, a signal handler is called. This signal handler determines whether it has been called for a Java or non-Java thread.
If the signal is for a Java thread, the JVM takes control of the signal handling. If an application handler for this signal is installed and you did not specify the -Xnosigchain command-line option, the application handler for this signal is called after the JVM has finished processing.
If the signal is for a non-Java thread, and the application that installed the JVM had previously installed its own handler for the signal, control is given to that handler. Otherwise, if the signal is requested by the JVM or Java application, the signal is ignored or the default action is taken.
For exception and error signals, the JVM either:
For interrupt signals, the JVM also enters a controlled shut down sequence, but this time it is treated as a normal termination that:
The shut down is identical to the shut down initiated by a call to the Java method System.exit().
Other signals that are used by the JVM are for internal control purposes and do not cause it to stop. The only control signal of interest is SIGQUIT, which causes a Javadump to be generated.
The types of signals are Exceptions, Errors, Interrupts, and Controls.
Table 1 shows the signals that are used by the JVM. The signals are grouped in the table by type or use, as follows:
Signal Name | Signal type | Description | Disabled by -Xrs |
---|---|---|---|
SIGBUS (7) | Exception | Incorrect access to memory (data misalignment) | Yes |
SIGSEGV (11) | Exception | Incorrect access to memory (write to inaccessible memory) | Yes |
SIGILL (4) | Exception | Illegal instruction (attempt to call an unknown machine instruction) | Yes |
SIGFPE (8) | Exception | Floating point exception (divide by zero) | Yes |
SIGABRT (6) | Error | Abnormal termination. The JVM raises this signal whenever it detects a JVM fault. | Yes |
SIGINT (2) | Interrupt | Interactive attention (CTRL-C). JVM exits normally. | Yes |
SIGTERM (15) | Interrupt | Termination request. JVM will exit normally. | Yes |
SIGHUP (1) | Interrupt | Hang up. JVM exits normally. | Yes |
SIGQUIT (3) | Control | By default, this triggers a Javadump. | Yes |
No Name (40) | Control | An AIX reserved signal. Used by the AIX JVM for internal control purposes. | Yes |
SIGRECONFIG (58) | Control | Reserved to detect any change in the number of CPUs, processing capacity, or physical memory. | Yes |
SIGTRAP (5) | Control | Used by the JIT. | Yes |
SIGRTMAX (2) | Control | Used by the SDK. | No |
SIGCHLD (17) | Control | Used by the SDK for internal control. | No |
Use the -Xrs (reduce signal usage) option to prevent the JVM from handling most signals. For more information, see Sun's Java application launcher page.
Do not use the -qflttrap C compiler setting because it provides the possibility of SIGTRAPs being generated, which might then affect the JIT. If you want to have floating point exceptions generated, include this call in your code so that it generates a SIGFPE signal:
fp_trap( FP_TRAP_SYNC)
If you install a signal handler for signal numbers 5 (SIGTRAP) or 58 (SIGRECONFIG), you affect JVM performance because these signals are used for internal control purposes.
Signals 1 (SIGHUP), 2 (SIGINT), 4 (SIGILL), 7 (SIGBUS), 8 (SIGFPE), 11 (SIGSEGV), and 15 (SIGTERM) on JVM threads cause the JVM to shut down; therefore, an application signal handler should not attempt to recover from these unless it no longer requires the JVM.
The Runtime Environment contains signal-chaining. Signal-chaining enables the JVM to interoperate more efficiently with native code that installs its own signal handlers.
The libjsig.a library ensures that calls such as signal(), sigset(), and sigaction() are intercepted so that their handlers do not replace the JVM's signal handlers. Instead, these calls save the new signal handlers, or "chain" them behind the handlers that are installed by the JVM. Later, when any of these signals are raised and found not to be targeted at the JVM, the preinstalled handlers are invoked.
If you install signal handlers that use sigaction() , some sa_flags are not observed when the JVM uses the signal. These are:
The libjsig.a library also hides JVM signal handlers from the application. Therefore, calls such as signal(), sigset(), and sigaction() that are made after the JVM has started no longer return a reference to the JVM's signal handler, but instead return any handler that was installed before JVM startup.
The environment variable JAVA_HOME should be set to the location of the SDK, for example,/usr/java5_64/.
To use libjsig.a:
cc_r -q64 <other compile/link parameter> -L/usr/java5_64/jre/bin -ljsig -L/usr/java5_64/jre/bin/j9vm -ljvm java_application.c
Valid Java Native Interface (JNI) version numbers that programs can specify on the JNI_CreateJavaVM() API call are: JNI_VERSION_1_2(0x00010002) and JNI_VERSION_1_4(0x00010004).
This version number determines only the level of the JNI to use. The actual level of the JVM that is created is specified by the JSE libraries (that is, v5.0). The JNI level does not affect the language specification that is implemented by the JVM, the class library APIs, or any other area of JVM behavior. For more information, see http://java.sun.com/j2se/1.5.0/docs/guide/jni.
If your application needs two JNI libraries, one built for 32- and the other for 64-bit, use the com.ibm.vm.bitmode system property to determine if you are running with a 32- or 64-bit JVM and choose the appropriate library.
There is a readme file and example programs in the /usr/java5_64/demo/jni directory. The demos can be optionally installed with the Java6_64.samples package.
If you are writing a C or C++ program that uses the JNI Invocation API (that is, the program creates a Java Virtual Machine and calls Java code), you might want to ensure that the following variables are set appropriately. By default, all the Java launchers that are shipped with the SDK (for example, java, jar) set up these environment variables to the values that are specified as follows:
When you build a C or C++ program that uses the invocation API, your LIBPATH must include the directories containing the JVM's shared libraries, /usr/java5_64/jre/bin/ and /usr/java5_64/jre/bin/j9vm, as well as the directories that contain the application's shared libraries.
You must build:
The SDK does not support runtime linking (using the -brtl loader option). Any applications that are built for use with the SDK must not rely on runtime linking functionality.
You are recommended to compile your native methods (C or C++ functions called by Java) into AIX shared objects (dynamically loaded libraries). For example, if your native methods are stored in the file nm.c, you could create the shared object with the following command:
cc_r -qmkshrobj -q64 -I /usr/java5_64/include -o libnm.a nm.cThe -qmkshrobj option disables runtime linking. For more details about shared object files, runtime linking, and the use of cc and ld command-line options, see:
Before running a Java program that uses native methods, ensure that LIBPATH contains the list of directories that are holding the native methods' shared objects. For more information about building AIX shared objects, see C and C++ Application Development on AIX. Go to http://www.ibm.com/redbooks and search for "SG245674".
If you set the setuid or setgid attribute on JNI native code programs, that setting changes the effective LIBPATH environment variable. This change might cause unexpected or incorrect behavior with those programs. For more details about this usage, see Developing and Porting C and C++ Applications on AIX at http://www.redbooks.ibm.com/abstracts/sg245674.html, section 2.3.3.
When building a C or C++ program that uses the JNI Invocation API to create a Java virtual machine and calls Java code, use the:
For example, this command builds a C program (invAPITest.c) that uses the JNI Invocation API:
cc_r -q64 -I/usr/java5_64/include -o invAPITest -L/usr/lib -L/lib -L/usr/java5_64/jre/bin/j9vm -L/usr/java5_64/jre/bin/ -ljvm invAPITest.c
When executing a C or C++ program that uses the JNI Invocation API to run Java classes, ensure that the class path is set up correctly to enable the Java Virtual Machine (JVM) to find your class files. If you modify Java's boot class path, include the SDK files that are necessary to run your applications.
To determine whether a C or C++ program that is using the JNI Invocation API was built with the -bM:UR option, use the command:
>dump -X64 -ov <program name> ***Object Module Header*** # Sections Symbol Ptr # Symbols Opt Hdr Len Flags 4 0x0001a728 1305 120 0x1002 Flags=( EXEC DYNLOAD DEP_SYSTEM ) Timestamp = "14 Oct 03:26:43 2005" Magic = 0x1f7 (64-bit XCOFF) ***Optional Header*** Tsize Dsize Bsize Tstart Dstart 0x000127f8 0x00001b80 0x00000470 0x1000001f8 0x1100009f0 SNloader SNentry SNtext SNtoc SNdata 0x0004 0x0002 0x0001 0x0002 0x0002 TXTalign DATAalign TOC vstamp entry 0x0005 0x0003 0x110002158 0x0001 0x110002040 maxSTACK maxDATA SNbss magic modtype 0x00000000 0x00000000 0x0003 0x010b UR
If the modtype is not UR, you can use the LDR_CNTRL environment variable to make programs behave as though they were compiled with the -bM:UR binder option. For example:
export LDR_CNTRL=USERREGS
If you need to specify multiple options with LDR_CNTRL, separate those options with the "@" symbol.
Java threads that are created by the SDK use the POSIX pthreads model that is supported on AIX. Currently, this is on a 1-to-1 mapping with the kernel threads. When developing a JNI program, you must run with a 1-to-1 thread model and system contention scope if creating pthreads in your own program. You can control this by using the following environment setting:
export AIXTHREAD_SCOPE=S
Another option is to preset the thread's scope attribute to PTHREAD_SCOPE_SYSTEM using the AIX pthread_attr_setscope function when the thread is created. For more details on thread model and system contention scope, see:
From Java V5.0, you can store native methods in these ways:
Programs can also link dynamically to AIX shared libraries and shared objects using the dlopen() family of subroutines. The SDK links in this way when it loads native libraries (for example, System.load(), System.loadLibrary(), Runtime.getRuntime().load(), Runtime.getRuntime().loadLibrary()).
For information about dlopen, see:
For information about AIX loading and linking mechanisms, see: http://public.dhe.ibm.com/software/dw/aix/es-aix_ll.pdf
To load an AIX shared library, make a call to:
System.loadLibrary("<library>(<member>)")
where <library> is the name of the shared library archive and <member> is the name of an archive member. For example:
System.loadLibrary("libShared.a(libSample.o)")
This example takes you through the process of using native shared libraries with a Java application on AIX.
public class Sample { public native void printFromNative( ); public static void main( String[] args ) { Sample sample = new Sample( ); sample.printFromNative( ); } static { String sharedLibrary = "libShared.a(libSample.o)"; try { System.loadLibrary( sharedLibrary ); } catch ( Exception e ) { System.out.println( "ERROR: Unable to load " + sharedLibrary ); e.printStackTrace( ); } } }
javac Sample.java
javah Sample
#include <stdio.h> #include "Sample.h" JNIEXPORT void JNICALL Java_Sample_printFromNative( JNIEnv * env, jobject obj ) { printf( "Printing from native\n" ); }
cc_r -bM:SRE -bnoentry -bexpall -I/usr/java5_64/include Sample.c -o libSample.o -q64
ar -X64 -v -q libShared.a libSample.o
LIBPATH=. java SampleThe program will output:
Printing from native
You should now be able to use the same framework to access native shared libraries from Java applications.
Four new IBM-specific SDK classes have been added to the com.ibm.jvm package to support the thread-level recovery of Blocked connectors. The new classes are packaged in core.jar.
These classes allow you to unblock threads that have become blocked on networking or synchronization calls. If an application does not use these classes, it must end the whole process, rather than interrupting an individual blocked thread.
The classes are:
Both InterruptibleLockContext and InterruptibleIOContext work by referencing the current thread. Therefore if you do not use InterruptibleThread, you must provide your own class that extends java.lang.Thread, to use these new classes.
The Javadoc information for these classes is provided with the SDK in the docs/apidoc.zip file.
The Java Platform, Standard Edition (J2SE) supports, at a minimum, the specifications that are defined in the compliance document from Sun. In some cases, the IBM J2SE ORB supports more recent versions of the specifications.
The minimum specifications supported are defined in the Official Specifications for CORBA support in J2SE: http://java.sun.com/j2se/1.5.0/docs/api/org/omg/CORBA/doc-files/compliance.html.
This SDK supports all versions of GIOP, as defined by chapters 13 and 15 of the CORBA 2.3.1 specification, OMG document formal/99-10-07.
http://www.omg.org/cgi-bin/doc?formal/99-10-07
Bidirectional GIOP is not supported.
This SDK supports Portable Interceptors, as defined by the OMG in the document ptc/01-03-04, which you can obtain from:
http://www.omg.org/cgi-bin/doc?ptc/01-03-04
Portable Interceptors are hooks into the ORB that ORB services can use to intercept the normal flow of execution of the ORB.
This SDK supports the Interoperable Naming Service, as defined by the OMG in the document ptc/00-08-07, which you can obtain from:
http://www.omg.org/cgi-bin/doc?ptc/00-08-07
The default port that is used by the Transient Name Server (the tnameserv command), when no ORBInitialPort parameter is given, has changed from 900 to 2809, which is the port number that is registered with the IANA (Internet Assigned Number Authority) for a CORBA Naming Service. Programs that depend on this default might have to be updated to work with this version.
The initial context that is returned from the Transient Name Server is now an org.omg.CosNaming.NamingContextExt. Existing programs that narrow the reference to a context org.omg.CosNaming.NamingContext still work, and do not need to be recompiled.
The ORB supports the -ORBInitRef and -ORBDefaultInitRef parameters that are defined by the Interoperable Naming Service specification, and the ORB::string_to_object operation now supports the ObjectURL string formats (corbaloc: and corbaname:) that are defined by the Interoperable Naming Service specification.
The OMG specifies a method ORB::register_initial_reference to register a service with the Interoperable Naming Service. However, this method is not available in the Sun Java Core API at Version 5.0. Programs that have to register a service in the current version must invoke this method on the IBM internal ORB implementation class. For example, to register a service "MyService":
((com.ibm.CORBA.iiop.ORB)orb).register_initial_reference("MyService", serviceRef);
Where orb is an instance of org.omg.CORBA.ORB, which is returned from ORB.init(), and serviceRef is a CORBA Object, which is connected to the ORB. This mechanism is an interim one, and is not compatible with future versions or portable to non-IBM ORBs.
A runtime debug feature provides improved serviceability. You might find it useful for problem diagnosis or it might be requested by IBM service personnel.
For example, to trace events and formatted GIOP messages from the command line, type:
java -Dcom.ibm.CORBA.Debug=true -Dcom.ibm.CORBA.CommTrace=true <myapp>
Do not enable tracing for normal operation, because it might cause performance degradation. Even if you have switched off tracing, FFDC (First Failure Data Capture) is still working, so serious errors are reported. If a debug output file is generated, examine it to check on the problem. For example, the server might have stopped without performing an ORB.shutdown().
The content and format of the trace output might vary from version to version.
The ORB can be tuned to work well with your specific network. The properties required to tune the ORB are described here.
To disable fragmentation, set the fragment size to 0 bytes:
java -Dcom.ibm.CORBA.FragmentSize=0 <myapp>
When running with a Java SecurityManager, invocation of some methods in the CORBA API classes might cause permission checks to be made, which might result in a SecurityException. If your program uses any of these methods, ensure that it is granted the necessary permissions.
Class/Interface | Method | Required permission |
---|---|---|
org.omg.CORBA.ORB | init | java.net.SocketPermission resolve |
org.omg.CORBA.ORB | connect | java.net.SocketPermission listen |
org.omg.CORBA.ORB | resolve_initial_references | java.net.SocketPermission connect |
org.omg.CORBA. portable.ObjectImpl | _is_a | java.net.SocketPermission connect |
org.omg.CORBA. portable.ObjectImpl | _non_existent | java.net.SocketPermission connect |
org.omg.CORBA. portable.ObjectImpl | OutputStream _request (String, boolean) | java.net.SocketPermission connect |
org.omg.CORBA. portable.ObjectImpl | _get_interface_def | java.net.SocketPermission connect |
org.omg.CORBA. Request | invoke | java.net.SocketPermission connect |
org.omg.CORBA. Request | send_deferred | java.net.SocketPermission connect |
org.omg.CORBA. Request | send_oneway | java.net.SocketPermission connect |
javax.rmi. PortableRemoteObject | narrow | java.net.SocketPermission connect |
A list of the ORB implementation classes.
The ORB implementation classes in this release are:
These are the default values, and you are advised not to set these properties or refer to the implementation classes directly. For portability, make references only to the CORBA API classes, and not to the implementation. These values might be changed in future releases.
Java Remote Method Invocation (RMI) provides a simple mechanism for distributed Java programming. RMI over IIOP (RMI-IIOP) uses the Common Object Request Broker Architecture (CORBA) standard Internet Inter-ORB Protocol (IIOP) to extend the base Java RMI to perform communication. This allows direct interaction with any other CORBA Object Request Brokers (ORBs), whether they were implemented in Java or another programming language.
The following documentation is available:
Thread pooling for RMI Connection Handlers is not enabled by default.
To enable the connection pooling implemented at the RMI TCPTransport level, set the option
-Dsun.rmi.transport.tcp.connectionPool=true
This version of the Runtime Environment does not have a setting that you can use to limit the number of threads in the connection pool.
From Java 5.0, the IBM BigDecimal class has been adopted by Sun as java.math.BigDecimal. The com.ibm.math.BigDecimal class is reserved for possible future use by IBM and is currently deprecated. Migrate existing Java code to use java.math.BigDecimal.
The new java.math.BigDecimal uses the same methods as both the previous java.math.BigDecimal and com.ibm.math.BigDecimal. Existing code using java.math.BigDecimal continues to work correctly. The two classes do not serialize.
To migrate existing Java code to use the java.math.BigDecimal class, change the import statement at the top of your .java file from: import com.ibm.math.*; to import java.math.*;.
On AIX 5.2, Java runs with system contention scope threads (AIXTHREAD_SCOPE=S). This way of running means that each Java thread is mapped one-to-one to an AIX kernel thread and that these kernel threads are scheduled against all other threads in the system. Each thread has an initial priority that is dynamically modified by the AIX scheduler, according to the thread's activity; thread execution is time-sliced. As such, the Java interfaces for setting thread priority have no effect on the thread's actual priority.
From AIX 5.3 onwards, programs can set the priority of system contention scope threads. Calls to java.lang.Thread.setPriority() will change the priority of Java threads running on AIX 5.3.
For more information about AIX dynamic thread scheduling, see:
http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/genprogc/threads_sched.htm
For more information about AIX 5.3 thread scheduling, see:
http://publib.boulder.ibm.com/infocenter/pseries/index.jsp?topic=/com.ibm.aix.doc/libs/basetrf1/pthread_setschedparam.htm and http://publib.boulder.ibm.com/infocenter/pseries/index.jsp?topic=/com.ibm.aix.doc/aixprggd/genprogc/threads_sched.htm.
The IBM 64-bit SDK for AIX, v5.0 provides a unified interface, the Java Naming and Directory Interface (JNDI), to the naming and directory services.
These naming and directory services are supported by JNDI:
The Java Virtual Machine Profiling Interface (JVMPI) has been extended to include profiling in the IBM JIT. These additional definitions are listed in jvmpi.h.
To enable the JVMPI function GetCurrentThreadCPUTime, you must enable AIX resource collection by setting the environment variable AIXTHREAD_ENRUSG.
When the resource collection is enabled, the HPROF profiling agent, started with -Xrunhprof:cpu=times provides meaningful data in the HPROF output.
Type the following command at the shell prompt:
export AIXTHREAD_ENRUSG=ON
You will get the following message when performance profiling is switched on:
Warning: Performance profiling is enabled and can cause performance degradation. Warning: You can unset AIXTHREAD_ENRUSG to disable performance profiling.
Make sure that the resource collection is disabled after your profiling session because the added processor usage when tracking CPU time for individual threads affects performance. Resource collection should never be enabled in a production environment. To disable the resource collection, do one of the following:
unset AIXTHREAD_ENRUSG export AIXTHREAD_ENRUSG=OFF
By default, resource collection is disabled.
The JVMPI_EVENT_INSTRUCTION_START event is not currently supported in the IBM 64-bit SDK for AIX, v5.0. It might be added in a future release.
This release includes Java 3D for AIX, Version 1.3.
The file set, Java6.ext.java3d, is optionally installable. For more information, read /usr/java5_64/java3d/README.java3d.aix.txt after installing the file set.
The IBM 64-bit SDK for AIX, v5.0 supports XToolkit from Service Refresh 4. You need XToolkit when using the SWT_AWT bridge in Eclipse to build an application that uses both SWT and Swing. XToolkit is an alternative to the existing use of MToolkit libraries, with the benefit of faster rendering.
Related links:
The Java Attach API allows your application to connect to another virtual machine (the "target"). Your application can then load an agent application into the target virtual machine, for example to perform tasks such as monitoring status.
Code for agent applications, such as JMX agents or JVMTI agents, is normally loaded during virtual machine startup by specifying special startup parameters. Requiring startup parameters might not be convenient for using agents on applications that are already running, such as WebSphere Application Servers. Using the Java Attach API, lets you load an agent at any time by specifying the process ID of the target virtual machine. The Attach API capability is sometimes called the "late attach" capability.
The Attach API is disabled by default for Java 5 SR 11 and later.
Security for the Java Attach API is handled by UNIX® user and group file permissions.
The Java Attach API creates files and directories in a common directory. The common directory, subdirectories, and files in it, have UNIX file permissions. It is recommended that you change the ownership of the common directory to ROOT or another privileged user ID, to prevent 'spoofing' attacks.
The key security features of the Java Attach API are:
You must secure access to the Java Attach API capability to ensure that only authorized users or processes can connect to another virtual machine. If you do not intend to use the Java Attach API capability, disable this feature using the Java system property. Set the com.ibm.tools.attach.enable system property to the value no; for example:
-Dcom.ibm.tools.attach.enable=no
By default, the target virtual machine is identified by its process ID. To use a different target, change the system property com.ibm.tools.attach.id; for example:
-Dcom.ibm.tools.attach.id=<process_ID>
The target process also has a human-readable "display name". By default, the display name is the process ID. To change the default display name, use the com.ibm.tools.attach.displayName system property. The ID and display name cannot be changed after the application has started.
The Attach API creates working files in a common directory called .com_ibm_tools_attach, which is created in the system temporary directory. The system property java.io.tmpdir holds the value of the system temporary directory. On non-Windows® systems, the system temporary directory is typically /tmp. To modify the working directory, use the Java system property com.ibm.tools.attach.directory; for example:
-Dcom.ibm.tools.attach.directory=/working
If your Java application ends abnormally, for example, following a crash or a SIGKILL signal, the process subdirectory is not deleted. The Java VM detects and removes obsolete subdirectories where possible. The subdirectory can also be deleted by the owning userid.
On heavily loaded system, applications might experience timeouts when attempting to connect to target applications. The default timeout is 120 seconds. Use the com.ibm.tools.attach.timeout system property to specify a different timeout value in seconds. For example, to timeout after 60 seconds:
-Dcom.ibm.tools.attach.timeout=60
A timeout value of zero indicates an indefinite wait.
For JMX applications, you might need to disable authentication by editing the <JAVA_HOME>/jre/lib/management/management.properties file. Set the following properties to disable authentication in JMX:
com.sun.management.jmxremote.authenticate=false com.sun.management.jmxremote.ssl=false
An unsuccessful attempt to invoke the Attach API results in one of the following exceptions:
A useful reference for information about the Attach API can be found at http://java.sun.com/javase/6/docs/technotes/guides/attach/index.html. The IBM implementation of the Attach API corresponds approximately to the Sun Microsystems, Inc. implementation. However, if your application originally used com.sun.tools.attach.* methods or classes, you must modify and recompile the application to use the com.ibm.tools.attach.* implementation.
public void loadAgent(String agent) public void loadAgent(String agent, String options)are not available.
The Java plug-in is used to run Java applications in the browser. The appletviewer is used to test applications designed to be run in a browser.
The Java plug-in is a Web browser plug-in. You use the Java plug-in to run applets in the browser.
You must allow applets to finish loading to prevent your browser from stopping. For example, if you use the Back button and then the Forward button while an applet is loading, the HTML pages might be unable to load.
The Java plug-in is documented by Sun at: http://java.sun.com/j2se/1.5.0/docs/guide/plugin/developer_guide/.
The Java plug-in supports Mozilla Firefox.
Browser | Supported Versions |
---|---|
Firefox | 1.7, 2.0, Available at http://www.ibm.com/servers/aix/browsers/. |
To install the Java plug-in, symbolically link it to the plug-in directory for your browser.
The Java plug-in is based on Mozilla's Open JVM Integration initiative, which is used with most Mozilla products and derivatives, including Firefox.
You must symbolically link the plug-in, rather than copy it, so that the browser and plug-in can locate the JVM.
You can change the properties of the Java Plug-in from the control panel, which can be run as a stand-alone Java application.
To start this Java application, run the script:
/usr/java5_64/jre/bin/ControlPanel
Because of limitations in particular browsers, you might not be able to implement all the functions of the org.w3c.dom.html package.
One of the following errors is thrown:
The Java plug-in supports double-byte characters (for example, Chinese Traditional BIG-5, Korean, and Japanese) as parameters for the tags <APPLET>, <OBJECT>, and <EMBED>. You must select the correct character encoding for your HTML document so that the Java plug-in can parse the parameter.
Specify character encoding for your HTML document by using the <META> tag in the <HEAD> section like this:
<meta http-equiv="Content-Type" content="text/html; charset=big5">
This example tells the browser to use the Chinese BIG-5 character encoding to parse the HTML file.
Some older versions of browsers might not understand this tag correctly. In this case, you can force the browser to ignore this tag, but you might have to change the encoding manually. To manually specify which encoding you want to use to parse the HTML file:
With the Applet Viewer, you can run one or more applets that are called by reference in a Web page (HTML file) by using the <APPLET> tag. The Applet Viewer finds the <APPLET> tags in the HTML file and runs the applets, in separate windows, as specified by the tags.
Because the Applet Viewer is for viewing applets, it cannot display a whole Web page that contains many HTML tags. It parses only the <APPLET> tags and no other HTML on the Web page.
Use the following commands to run and debug an applet with the Applet Viewer.
Running applets with the Applet Viewer:
From a shell prompt, enter:
appletviewer <name>
where <name> is one of the following:
For example, to start the Applet Viewer on an HTML file that calls an applet, type at a shell prompt:
appletviewer $HOME/<filename>.html
Where filename is the name of the HTML file.
To start the Applet Viewer on a Web page, type at a shell prompt:
appletviewer http://java.sun.com/applets/jdk/1.4/demo/applets/NervousText/example1.html
The Applet Viewer does not recognize the charset option of the <
META
> tag. If the file that the Applet Viewer loads is not encoded as the system default, an I/O exception might occur. To avoid the exception, use the -encoding option when you run appletviewer. For example:
appletviewer -encoding JISAutoDetect sample.html
Debugging applets with the Applet Viewer:
For example:
cd demo/applets/TicTacToe ../../bin/appletviewer -debug example1.html
You can find documentation about how to debug applets using the Applet Viewer at the Sun Web site: http://java.sun.com/j2se/1.5.0/docs/guide/plugin/developer_guide/debugger.html.
If you use the Applet Viewer to run an applet that is in the CLASSPATH, you might get an AccessControlException in Swing. Because the CLASSPATH implicitly contains the current directory ".", this exception might occur if you run the Java Plug-in in the same directory that the applet class itself is in.
To work around this problem, ensure that:
Java applications typically consist of class, resource, and data files.
When you distribute a Java application, your software package probably consists of the following parts:
To run your application, a user needs the Runtime Environment for AIX. The SDK for AIX software contains a Runtime Environment. However, you cannot assume that your users have the SDK for AIX software installed.
Your application can either make the SDK for AIX a prerequisite or include a version of the SDK that is specifically for the purpose of redistribution. The SDK for AIX license does not allow you to redistribute any of the SDK files installed in /usr/java5_64/ by installp. You can redistribute the SDK files in the j664redist.tar or j664redist.tar.gz file (after viewing and agreeing to the associated online license) available from the AIX Java Web site: http://www.ibm.com/developerworks/java/jdk/aix/. Click the Download and service information link near the bottom of the page and follow the links to the Java download page.
Class data sharing enables multiple JVMs to share a single space in memory.
You can share data between Java Virtual Machines (JVMs) by storing it in a cache in shared memory. Sharing reduces the overall virtual storage consumption when more than one JVM shares a cache. Sharing also reduces the startup time for a JVM after the cache has been created. The shared class cache is independent of any active JVM and persists beyond the lifetime of the JVM that created the cache.
A shared cache can contain:
Class data sharing provides a method of reducing memory footprint and improving JVM start-up time.
Enable class data sharing by using the -Xshareclasses option when starting a JVM. The JVM connects to an existing cache or creates a new cache if one does not exist.
All bootstrap and application classes loaded by the JVM are shared by default. Custom classloaders share classes automatically if they extend the application classloader. Otherwise, they must use the Java Helper API provided with the JVM to access the cache. See Adapting custom classloaders to share classes.
Any JVM connected to a cache can update the cache. Any number of JVMs can concurrently read from the cache, even while another JVM is writing to it.
You must take care if runtime bytecode modification is being used. See Runtime bytecode modification for more information.
The shared class cache persists beyond the lifetime of any JVM. Therefore, the cache is updated dynamically to reflect any modifications that might have been made to JARs or classes on the file system. The dynamic updating makes the cache independent of the application using it.
Access to the shared class cache is limited by operating system permissions and Java security permissions. The shared class cache is created with user access by default unless the groupAccess command-line suboption is used. Only a classloader that has registered to share class data can update the shared class cache.
If a Java SecurityManager is installed, classloaders, excluding the default bootstrap, application, and extension classloaders, must be granted permission to share classes. Grant permission by adding SharedClassPermission lines to the java.policy file. See Using SharedClassPermission for more information. The RuntimePermission createClassLoader restricts the creation of new classloaders and therefore also restricts access to the cache.
Multiple caches can exist on a system and you specify them by name as a suboption to the -Xshareclasses command. A JVM can connect to only one cache at any one time.
You can override the default cache size on startup using -Xscmx<n><size>. This size is then fixed for the lifetime of the cache. Caches exist until they are explicitly deleted using a suboption to the -Xshareclasses command or until the system is rebooted.
All cache utilities are suboptions to the -Xshareclasses command. See Class data sharing command-line options or use -Xshareclasses:help to see a list of available suboptions.
Class data sharing and the cache management utilities are controlled using command-line options to the Java launcher.
For options that take a <size> parameter, suffix the number with "k" or "K" to indicate kilobytes, "m" or "M" to indicate megabytes, or "g" or "G" to indicate gigabytes.
You can use the following suboptions with the -Xshareclasses option:
See the Diagnostics Guide for more information.
An overview of the life-cycle of a shared class data cache including examples of the cache management utilities.
To enable class data sharing, add -Xshareclasses[:name=<name>] to your application command line.
The JVM either connects to an existing cache of the given name or creates a new cache of that name. If a new cache is created, it is populated with all bootstrap and application classes being loaded until the cache becomes full. If two or more JVMs are started concurrently, they populate the cache concurrently.
To check that the cache has been created, run java -Xshareclasses:listAllCaches. To see how many classes and how much class data is being shared, run java -Xshareclasses:[name=<name>],printStats. You can run these utilities after the application JVM has terminated or in another command window.
For more feedback on cache usage while the JVM is running, use the verbose suboption. For example, java -Xshareclasses:[name=<name>],verbose.
To see classes being loaded from the cache or stored in the cache, add -Xshareclasses:[name=<name>],verboseIO to your application command line.
To delete the cache, run java -Xshareclasses:[name=<name>],destroy. You usually delete caches only if they contain many stale classes or if the cache is full and you want to create a bigger cache.
You should tune the cache size for your specific application, because the default is unlikely to be the optimum size. To determine the optimum cache size, specify a large cache, using -Xscmx, run the application, and then use printStats to determine how much class data has been stored. Add a small amount to the value shown in printStats for contingency. Because classes can be loaded at any time during the lifetime of the JVM, it is best to do this analysis after the application has terminated. However, a full cache does not have a negative affect on the performance or capability of any JVMs connected to it, so it is acceptable to decide on a cache size that is smaller than required.
If a cache becomes full, a message is displayed on the command line of any JVMs using the verbose suboption. All JVMs sharing the full cache then loads any further classes into their own process memory. Classes in a full cache can still be shared, but a full cache is read-only and cannot be updated with new classes.
Class data sharing is particularly useful on systems that use more than one JVM running similar code; the system benefits from reduced virtual storage consumption. It is also useful on systems that frequently start and shut down JVMs, which benefit from the improvement in startup time.
The processor and memory usage required to create and populate a new cache is minimal. The JVM startup cost in time for a single JVM is typically between 0 and 5% slower compared with a system not using class data sharing, depending on how many classes are loaded. JVM startup time improvement with a populated cache is typically between 10% and 40% faster compared with a system not using class data sharing, depending on the operating system and the number of classes loaded. Multiple JVMs running concurrently show greater overall startup time benefits.
Duplicate classes are consolidated in the shared class cache. For example, class A loaded from myClasses.jar and class A loaded from myOtherClasses.jar (with identical content) is stored only once in the cache. The printAllStats utility shows multiple entries for duplicated classes, with each entry pointing to the same class.
When you run your application with class data sharing, you can use the operating system tools to see the reduction in virtual storage consumption.
Consider these factors when deploying class data sharing in a product and using class data sharing in a development environment.
The maximum theoretical cache size is 2 GB. The size of cache you can specify is limited by the amount of physical memory and paging space available to the system.
The cache for sharing classes is allocated using the System V IPC Shared memory mechanism.
Because the virtual address space of a process is shared between the shared classes cache and the Java heap, if you increase the maximum size of the Java heap you might reduce the size of the shared classes cache you can create.
The virtual address space available to the process is 1 TB on AIX 5.2, and 32 TB on AIX 5.3.
Any JVM using a JVM Tool Interface (JVMTI) agent that can modify bytecode data must use the modified=<modified_context> suboption if it wants to share the modified classes with another JVM.
The modified context is a user-specified descriptor that describes the type of modification being performed. The modified context partitions the cache so that all JVMs running under the same context share a partition.
This partitioning allows JVMs that are not using modified bytecode to safely share a cache with those that are using modified bytecode. All JVMs using a given modified context must modify bytecode in a predictable, repeatable manner for each class, so that the modified classes stored in the cache have the expected modifications when they are loaded by another JVM. Any modification must be predictable because classes loaded from the shared class cache cannot be modified again by the agent.
If a JVMTI agent is used without a modification context, classes are still safely shared by the JVM, but with a small affect on performance. Using a modification context with a JVMTI agent avoids the need for extra checks and therefore has no affect on performance. A custom ClassLoader that extends java.net.URLClassLoader and modifies bytecode at load time without using JVMTI automatically stores that modified bytecode in the cache, but the cache does not treat the bytecode as modified. Any other VM sharing that cache loads the modified classes. You can use the modified=<modification_context> suboption in the same way as with JVMTI agents to partition modified bytecode in the cache. If a custom ClassLoader needs to make unpredictable load-time modifications to classes, that ClassLoader must not attempt to use class data sharing.
See the Diagnostics Guide for more detail on this topic.
You cannot share classes between 32-bit and 64-bit JVMs. Temporary disk space must be available to hold cache information. The operating system enforces cache permissions.
For operating systems that can run both 32-bit and 64-bit applications, class data sharing is not permitted between 32-bit and 64-bit JVMs. The listAllCaches suboption lists 32-bit or 64-bit caches, depending on the address mode of the JVM being used.
The shared class cache requires disk space to store identification information about the caches that exist on the system. This information is stored in /tmp/javasharedresources. If the identification information directory is deleted, the JVM cannot identify the shared classes on the system and must re-create the cache. Use the ipcs command to view the memory segments used by a JVM or application.
Users running a JVM must be in the same group to use a shared class cache. The operating system enforces the permissions for accessing a shared class cache. If you do not specify a cache name, the user name is appended to the default name so that multiple users on the same system create their own caches by default.
If a SecurityManager is being used with class data sharing and the running application uses its own class loaders, you must grant these class loaders shared class permissions before they can share classes.
You add shared class permissions to the java.policy file using the ClassLoader class name (wildcards are permitted) and either "read", "write", or "read,write" to determine the access granted. For example:
permission com.ibm.oti.shared.SharedClassPermission "com.abc.customclassloaders.*", "read,write";
If a ClassLoader does not have the correct permissions, it is prevented from sharing classes. You cannot change the permissions of the default bootstrap, application, or extension class loaders.
Any classloader that extends java.net.URLClassLoader can share classes without modification. You must adopt classloaders that do not extend java.net.URLClassLoader to share class data.
You must grant all custom classloaders shared class permissions if a SecurityManager is being used; see Using SharedClassPermission. IBM provides several Java interfaces for various types of custom classloaders, which allow the classloaders to find and store classes in the shared class cache. These classes are in the com.ibm.oti.shared package.
The Javadoc document for this package is provided with the SDK in the docs/apidoc.zip file.
See the Diagnostics Guide for more information about how to use these interfaces.
The Java Communications (API) package (JavaComm) is an optional package provided for use with the Runtime Environment for AIX. You install JavaComm independently of the SDK or Runtime Environment.
The JavaComm API gives Java applications a platform-independent way of performing serial and parallel port communications for technologies such as voice mail, fax, and smartcards.
The Java Communications API supports Electronic Industries Association (EIA)-232 (RS232) serial ports and Institute of Electrical and Electronics Engineers (IEEE) 1284 parallel ports and is supported on systems with the IBM Version 5.0 Runtime Environment.
Using the Java Communications API, you can:
The API is shipped in the Java5_64.ext.commapi fileset (optionally installable).
By default, the Java Communications API files are installed in the /usr/java5_64/ directory.
The files and their structure are:
The Java communications API supports an unlimited number of tty's, with ttyn mapped to COM(n+1).
For example:
/dev/tty0 -> COM1 /dev/tty1 -> COM2 ... /dev/tty9 -> COM10 /dev/tty10 -> COM11 ...
If a tty is not available, the corresponding COM port is not available. For example, if tty0 and tty2 are available but tty1 is not, COM1 and COM3 are available but COM2 is not.
To use the Java Communications API, you must change the access mode of serial and parallel ports, and set the PATH if you did not set it when you installed Java.
See Setting the path.
Use the javax.comm.properties file to specify the devices and drivers that are available to the Java Communications API and whether they are parallel or serial. Do not change this file without a very clear understanding of its use.
Port numbers are allocated sequentially to all devices. For example, if you specify /dev/ttyS=PORT_SERIAL and the devices /dev/ttyS0 and /dev/ttyS1 exist, they will be allocated COM1 and COM2.
To use the USB-serial connectors, uncomment the line /dev/ttyUSB=PORT_SERIAL in the javax.comm.properties file. If the devices /dev/ttyUSB0 and /dev/ttyUSB1 exist and COM1 and COM2 have already been defined, the USB-serial devices are allocated the next sequential ports, COM3 and COM4.
When printing with the Java Communications API, you might have to select "Form feed", "Continue", or a similar option on the printer.
You can find API documentation and samples for the Java Communications API at the Sun Web site.
http://java.sun.com/products/javacomm/.
Contact points for service:
If you are entitled to services for the Program code pursuant to the IBM Solutions Developer Program, contact the IBM Solutions Developer Program through your usual method of access or on the Web at: http://www.ibm.com/partnerworld/.
If you have purchased a service contract (that is, the IBM Personal Systems Support Line or equivalent service by country), the terms and conditions of that service contract determine what services, if any, you are entitled to receive with respect to the Program.
The user guides that are supplied with this SDK and the Runtime Environment have been tested using screen readers.
To change the font sizes in the user guides, use the function that is supplied with your browser, typically found under the View menu option.
For users who require keyboard navigation, a description of useful keystrokes for Swing applications is in Swing Key Bindings at http://www.ibm.com/developerworks/java/jdk/additional/.
If you traverse the drop-down list of a JComboBox component with the cursor keys, the button or editable field of the JComboBox does not change value until an item is selected. This is the correct behavior for this release and improves accessibility and usability by ensuring that the keyboard traversal behavior is consistent with mouse traversal behavior.
If you have any comments about this user guide, contact us through one of the following channels. Note that these channels are not set up to answer technical queries, but are for comments about the documentation only.
Send your comments:
The fine print. By choosing to send a message to IBM, you acknowledge that all information contained in your message, including feedback data, such as questions, comments, suggestions, or the like, shall be deemed to be non-confidential and IBM shall have no obligation of any kind with respect to such information and shall be free to reproduce, use, disclose, and distribute the information to others without limitation. Further, IBM shall be free to use any ideas, concepts, know-how or techniques contained in such information for any purpose whatsoever, including, but not limited to, developing, manufacturing and marketing products incorporating such information.
You can specify the options on the command line while you are starting Java. They override any relevant environment variables. For example, using -cp <dir1> with the Java command completely overrides setting the environment variable CLASSPATH=<dir2>.
This chapter provides the following information:
Although the command line is the traditional way to specify command-line options, you can pass options to the JVM in other ways.
Use only single or double quotation marks for command-line options when explicitly directed to do so for the option in question. Single and double quotation marks have different meanings on different platforms, operating systems, and shells. Do not use '-X<option>' or "-X<option>". Instead, you must use -X<option>. For example, do not use '-Xmx500m' and "-Xmx500m". Write this option as -Xmx500m.
These precedence rules (in descending order) apply to specifying options:
For example, java -X<option> MyClass
In the options file, specify each option on a new line; you can use the '\' character as a continuation character if you want a single option to span multiple lines. Use the '#' character to define comment lines. You cannot specify -classpath in an options file. Here is an example of an options file:
#My options file -X<option1> -X<option2>=\ <value1>,\ <value2> -D<sysprop1>=<value1>
For example, set IBM_JAVA_OPTIONS=-X<option1> -X<option2>=<value1>
Use these options to print help on assert-related options, set the search path for application classes and resources, print a usage method, identify memory leaks inside the JVM, print the product version and continue, enable verbose output, and print the product version.
Callsites that do not provide callsite information are accumulated into an "unknown" entry.
<Loaded java/lang/String from C:\sdk\jre\lib\vm.jar> <Class size 17258; ROM size 21080; debug size 0> <Read time 27368 usec; Load time 782 usec; Translate time 927 usec>
Use the system property command-line options to set up your system.
The -Dsun.awt.keepWorkingSetOnMinimize=true system property stops the JVM trimming an application when it is minimized. The default behavior is to trim an application when it is minimized.
When a connection is made by an applet to a server and the server does not respond properly, the applet might seem to hang. The delay might also cause the browser to hang. The apparent hang occurs because there is no network connection timeout. To avoid this problem, the Java Plug-in has added a default value to the network timeout of 2 minutes for all HTTP connections. You can override the default by setting this property.
Use these options to configure your JVM. The options prefixed with -X are nonstandard.
For options that take a <size> parameter, suffix the number with "k" or "K" to indicate kilobytes, "m" or "M" to indicate megabytes, or "g" or "G" to indicate gigabytes.
For options that take a <percentage> parameter, use a number from 0 to 1. For example, 50% is 0.5.
Options that relate to the JIT are listed under JIT command-line options. Options that relate to the Garbage Collector are listed under Garbage Collector command-line options.
Enables message logging. To prevent message logging, use the -Xlog:none option. By default, logging is enabled. This option is available from Java 5 SR10. See Messages.
java -verbose:sizesThe maximum value for the stack size varies according to platform and specific machine configuration. If you exceed the maximum value, a java/lang/OutOfMemoryError message is reported.
Specifies a file that contains JVM options and definitions. By default, no option file is used.
The options file does not support these options:
Although you cannot use -Xoptionsfile recursively within an options file, you can use -Xoptionsfile multiple times on the same command line to load more than one options files.
<file> contains options that are processed as if they had been entered directly as command-line options. For example, the options file might contain:
-DuserString=ABC123 -Xmx256MB
Some options use quoted strings as parameters. Do not split quoted strings over multiple lines using the line continuation character '\'. The '¥' character is not supported as a line continuation character. For example, the following example is not valid in an options file:
-Xevents=vmstop,exec="cmd /c \ echo %pid has finished."
The following example is valid in an options file:
-Xevents=vmstop, \ exec="cmd /c echo %pid has finished."
Enables class sharing. This option can take a number of suboptions, some of which are cache utilities. Cache utilities perform the required operation on the specified cache, without starting the VM. You can combine multiple suboptions, separated by commas, but the cache utilities are mutually exclusive.
You can use the following suboptions with the -Xshareclasses option:
JVM command-line options that are specified with -XX are not stable and are not recommended for casual use.
These options are subject to change without notice.
When this option is enabled, Throwable.getStackTrace() returns an empty array and the stack trace is displayed when an uncaught exception occurs. Thread.getStackTrace() and Thread.getAllStackTraces() are not affected by this option.
Use these JIT compiler command-line options to control code compilation.
For more information about JIT , see the Diagnostics Guide (http://www.ibm.com/developerworks/java/jdk/diagnosis/50.html).
Use these Garbage Collector command-line options to control garbage collection.
You might need to read the section on "Memory management" in the Diagnostics Guide (http://www.ibm.com/developerworks/java/jdk/diagnosis/50.html) to understand some of the references that are given here.
The -verbose:gc option detailed in the section on "-verbose:gc logging" in the Diagnostics Guide (http://www.ibm.com/developerworks/java/jdk/diagnosis/50.html) is the main diagnostic aid that is available for runtime analysis of the Garbage Collector. However, additional command-line options are available that affect the behavior of the Garbage Collector and might aid diagnostics.
For options that take a <size> parameter, suffix the number with "k" or "K" to indicate kilobytes, "m" or "M" to indicate megabytes, or "g" or "G" to indicate gigabytes.
For options that take a <percentage> parameter, use a number from 0 to 1, for example, 50% is 0.5.
The default (no compaction option specified) makes the GC compact based on a series of triggers that attempt to compact only when it is beneficial to the future performance of the JVM.
Disables System.gc() calls.
Many applications still make an excessive number of explicit calls to System.gc() to request garbage collection. In many cases, these calls degrade performance through premature garbage collection and compactions. However, you cannot always remove the calls from the application.
The -Xdisableexplicitgc parameter allows the JVM to ignore these garbage collection suggestions. Typically, system administrators use this parameter in applications that show some benefit from its use.
By default, calls to System.gc() trigger a garbage collection.
The optthruput option is the default and delivers high throughput to applications, but at the cost of occasional pauses. Disables concurrent mark.
The optavgpause option reduces the time that is spent in these garbage collection pauses and limits the effect of increasing heap size on the length of the garbage collection pause. Use optavgpause if your configuration has a large heap. Enables concurrent mark.
The gencon option requests the combined use of concurrent and generational GC to help minimize the time that is spent in any garbage collection pause.
The subpool option (AIX, Linux and IBM i on IBM POWER architecture, and z/OS) uses an improved object allocation algorithm to achieve better performance when allocating objects on the heap. This option might improve performance on large SMP systems.
On systems running multiple JVMs or in LPAR environments where multiple JVMs can share the same physical CPUs, you might want to restrict the number of GC threads used by each JVM. The restriction helps prevent the total number of parallel operation GC threads for all JVMs exceeding the number of physical CPUs present, when multiple JVMs perform garbage collection at the same time.
If scavenger is enabled, -Xms >= -Xmn + -Xmo.
If scavenger is disabled, -Xms >= -Xmo.
Examples of the use of -Xms and -Xmx:
Causes -verbose:gc output to be written to the specified file. If the file cannot be found, -verbose:gc tries to create the file, and then continues as normal if it is successful. If it cannot create the file (for example, if an invalid filename is passed into the command), it redirects the output to stderr.
If you specify <X> and <Y> the -verbose:gc output is redirected to X files, each containing Y GC cycles.
The dump agent tokens can be used in the filename. See the Diagnostics Guide (http://www.ibm.com/developerworks/java/jdk/diagnosis/50.html) section on the "Dump agent tokens" for more information. If you do not specify <file>, verbosegc.m%d.1/28/11M%S.%pid.txt is used.
By default, no verbose GC logging occurs.
Known limitations on the SDK and Runtime Environment for AIX.
You can find more help with problem diagnosis in the Diagnostics Guide at http://www.ibm.com/developerworks/java/jdk/diagnosis/50.html.
If the data provided to your transformation is a DOM that you have created programmatically, the XSLT interpreter processor might have problems with implicit namespaces. The problems are incorrect namespace declarations, or the omission of namespace declarations from the resulting document. An example Java fragment follows:
// Example of an explicit namespace - an attribute node will be created in the DOM for xmlns='ht tp://my.org/project' String data = "<projectxmins='http://my.org/project/>"; Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(n ew StringReader(data))); // Example of an implicit namespace - no attribute node is created for the implicit namespace xm lns='http://your.org/project Element typeElem = doc.createElementNS("http://your.org/project", "type"); doc.getDocumentElement().appendChild(typeElem);
To work around this limitation you can use the XSLT compiler processor, XSLTC. You can specify the compiler processor by using the -XSLTC option with the Process command or by setting the javax.xml.transform.TransformerFactory service provider to org.apache.xalan.xsltc.trax.TransformerFactoryImpl.
Netbeans 5.0 does not run under the JVM with default settings. To enable Netbeans to run, set the javax.xml.transform.TransformerFactory=org.apache.xalan.xsltc.trax.TransformerFactoryImpl property in jre/lib/jaxp.properties.
On AIX 5.3, if a class is run using JDI, either directly or through JDB, the class does not return to the starting class.
In the IBM JConsole tool, the Local tab, which allows you to connect to other Virtual Machines on the same system, is not available. Also, the corresponding command line pid option is not supported. Instead, use the Remote tab in JConsole to connect to the Virtual Machine that you want to monitor. Alternatively, use the connection command-line option, specifying a host of localhost and a port number. When you start the application that you want to monitor, set these command-line options:
The IBM JConsole tool has the following limitations when the JIT is not enabled:
When using the JConsole monitoring tool with security enabled, there is no error message if you specify an incorrect path to a keystore in the Java launcher options. You cannot connect to the JConsole monitoring tool, and a connection failed message is displayed.
If you use the Mozilla browser there might be error messages when loading plug-ins. For example:
# mozilla LoadPlugin: failed to initialize shared library /jdk/java5/32bit/20071217/sdk/jre/bin/libjavaplugin_oji.so [ 0509-022 Cannot load module /jdk/java5/32bit/20071217/sdk/jre/bin/libjavaplugin_oji.so. 0509-150 Dependent module /lib/libgmodule.so could not be loaded. 0509-103 The module has an invalid magic number. 0509-026 System error: Cannot run a file that does not have a valid format. 0509-022 Cannot load module /lib/libgmodule.so. 0509-150 Dependent module /lib/libgmodule.so could not be loaded.]
The plug-in files must be in shared object format, and not in archive format. The reason is that the plug-in library looks for shared objects by default. Check the format of the files that are failing to load and change the format of archive (.a) files to shared object (.so). You can use the ar command to change the format.
Follow these steps to change the format of the libraries:
ar -x libgmodule-2.0.a ar -x libgtk-x11-2.0.a ar -x libgdk-x11-2.0.a
mv libgdk-x11-2.0.so.0 /usr/lib/libgdk.so mv libgmodule-2.0.so.0 /usr/lib/libgmodule.so mv libgtk-x11-2.0.so.0 /usr/lib/libgtk.so
If new classes are loaded after an Exception has been caught, the stack trace contained in the Exception might become incorrect. The stack trace becomes incorrect if classes in the stack trace are unloaded, and new classes are loaded into their memory segments.
Native programs cannot create a VM with JNI_VERSION_1_1(0x00010001) interfaces. You cannot call JNI_CreateJavaVM() and pass it a version of JNI_VERSION_1_1(0x00010001). The versions that can be passed are:
The VM created is determined by the Java libraries present (that is, 1.2.2, 1.3.x, 1.4.x, 5.x), not the one that is implied by the JNI interface version passed.
The interface version does not affect any area of VM behavior other than the functions available to native code.
In package java.lang.management, the methods ThreadMXBean.getThreadUserTime() and ThreadMXBean.getCurrentThreadUserTime() are not supported. These methods always return -1. These methods are not supported even when ThreadMXBean.isThreadCpuTimeSupported() and ThreadMXBean.isCurrentThreadCpuTimeSupported() return true. This limitation does not affect ThreadMXBean.getThreadCpuTime() or ThreadMXBean.getCurrentThreadCpuTime()
AIX 5.2 and AIX 5.3 only
For Japanese, Chinese, and Korean language users, you cannot use XIM to enter your own characters into text components on a Java applet in a Web browser. To work around this situation, specify the -Dsun.awt.noxembed=true system parameter to disable XEmbed. You can set this option by using the control panel:
This limitation is resolved in APAR IY77834 (AIX5.3) or APAR IY77820 (AIX5.2).
If you have difficulty with print operations, try increasing the size of the default file system that is used for print spooling to be larger than the printed PostScript® file size.
Text rendering for Java AWT TextField and TextArea components is performed by the AIX rasterizer for X/Motif text widgets. Currently, you might experience text dropouts at small font sizes for some fonts. To avoid the problem, use a font size that is greater than 12 points for AWT TextField and TextArea components.
If your system runs slowly when displaying AWT text components on AIX 5.2 in a Japanese environment (non-UTF-8 locale), apply APAR IY75960.
DBCS environments only
If your application fails with a NullPointerException using the GTK Look and Feel, unset the GNOME_DESKTOP_SESSION_ID environment variable.
You must close the candidate window and commit pre-edited strings before you switch the Input Method (IM) using the IM selection menu. If you open the IM selection menu without either closing the candidate window or committing a pre-edited string, cancel the menu, close the candidate window, and commit the pre-edited string, then try to switch the IM again.
DBCS characters might not display correctly in the title of a JFrame. To avoid this problem, set the language in the terminal login screen instead of in a prompt after you have logged in.
The C++ Runtime Environment (file set xlC.aix50.rte) version 8.0.0.3 contains an error that causes Java to stop (see http://www.ibm.com/support/docview.wss?uid=swg24012187). If you have this version of the C++ Runtime Environment installed, upgrade to version 8.0.0.4 or later.
When running the command java -Xshareclasses:destroy on a shared cache that is being used by a second JVM during startup, you might have the following issues:
This information was developed for products and services offered in the U.S.A.
IBM may not offer the products, services, or features discussed in this document in other countries. Consult your local IBM representative for information on the products and services currently available in your area. Any reference to an IBM product, program, or service is not intended to state or imply that only that IBM product, program, or service may be used. Any functionally equivalent product, program, or service that does not infringe any IBM intellectual property right may be used instead. However, it is the user's responsibility to evaluate and verify the operation of any non-IBM product, program, or service.
IBM may have patents or pending patent applications covering subject matter described in this document. The furnishing of this document does not grant you any license to these patents. You can send license inquiries, in writing, to:
For license inquiries regarding double-byte character set (DBCS) information, contact the IBM Intellectual Property Department in your country or send inquiries, in writing, to:
The following paragraph does not apply to the United Kingdom or any other country where such provisions are inconsistent with local law:
INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS PUBLICATION "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of express or implied warranties in certain transactions, therefore, this statement may not apply to you.
This information could include technical inaccuracies or typographical errors. Changes are periodically made to the information herein; these changes will be incorporated in new editions of the publication. IBM may make improvements and/or changes in the product(s) and/or the program(s) described in this publication at any time without notice.
Any references in this information to non-IBM Web sites are provided for convenience only and do not in any manner serve as an endorsement of those Web sites. The materials at those Web sites are not part of the materials for this IBM product and use of those Web sites is at your own risk.
IBM may use or distribute any of the information you supply in any way it believes appropriate without incurring any obligation to you.
Licensees of this program who wish to have information about it for the purpose of enabling: (i) the exchange of information between independently created programs and other programs (including this one) and (ii) the mutual use of the information which has been exchanged, should contact:
Such information may be available, subject to appropriate terms and conditions, including in some cases, payment of a fee.
The licensed program described in this document and all licensed material available for it are provided by IBM under terms of the IBM Customer Agreement, IBM International Program License Agreement or any equivalent agreement between us.
Any performance data contained herein was determined in a controlled environment. Therefore, the results obtained in other operating environments may vary significantly. Some measurements may have been made on development-level systems and there is no guarantee that these measurements will be the same on generally available systems. Furthermore, some measurements may have been estimated through extrapolation. Actual results may vary. Users of this document should verify the applicable data for their specific environment.
Information concerning non-IBM products was obtained from the suppliers of those products, their published announcements or other publicly available sources. IBM has not tested those products and cannot confirm the accuracy of performance, compatibility or any other claims related to non-IBM products. Questions on the capabilities of non-IBM products should be addressed to the suppliers of those products.
All statements regarding IBM's future direction or intent are subject to change or withdrawal without notice, and represent goals and objectives only.
COPYRIGHT LICENSE:
This information contains sample application programs in source language, which illustrate programming techniques on various operating platforms. You may copy, modify, and distribute these sample programs in any form without payment to IBM, for the purposes of developing, using, marketing or distributing application programs conforming to the application programming interface for the operating platform for which the sample programs are written. These examples have not been thoroughly tested under all conditions. IBM, therefore, cannot guarantee or imply reliability, serviceability, or function of these programs. The sample programs are provided "AS IS", without warranty of any kind. IBM shall not be liable for any damages arising out of your use of the sample programs.
Each copy or any portion of these sample programs or any derivative work, must include a copyright notice as follows:
© (your company name) (year). Portions of this code are derived from IBM Corp. Sample Programs. © Copyright IBM Corp. _enter the year or years_.
If you are viewing this information softcopy, the photographs and color illustrations may not appear.
IBM, the IBM logo, and ibm.com are trademarks or registered trademarks of International Business Machines Corporation in the United States, other countries, or both. If these and other IBM trademarked terms are marked on their first occurrence in this information with a trademark symbol (® or ™), these symbols indicate U.S. registered or common law trademarks owned by IBM at the time this information was published. Such trademarks may also be registered or common law trademarks in other countries. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at http://www.ibm.com/legal/copytrade.shtml.
UNIX is a registered trademark of The Open Group in the United States and other countries.
Java and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.
Other company, product, or service names may be trademarks or service marks of others.