|
The Java for HP-UX Programmer's Guide at Programmer's Guide for Java™ 2 contains usage documentation for developers. There you will find information on HotSpot options, HP-specific options and features, suggestions and examples for allocating memory, how to use wdb to examine backtraces in Java threads, code examples for using Java Native Interface, and more.
For more information, refer to Sun Microsystems' Java HotSpot VM Options at http://java.sun.com/docs/hotspot/VMOptions.html.
Removing support for unwanted architectures in the JRE
Under the JRE license agreement, partners who redistribute the JRE may remove support for unwanted architectures. Functional components may NOT be removed under any circumstances. You may remove support for unwanted architectures as explained below.
The following commands assume that the JRE has been installed in the standard location, that is, /opt/java6/.
- On PA-RISC, to remove 64-bit support:
/usr/sbin/swremove Jre60.JRE60-PA20W Jre60.JRE60-PA20W-HS
- On HP Integrity, to remove 64-bit support:
/usr/sbin/swremove Jre60.JRE60-IPF64 Jre60.JRE60-IPF64-HS
- PA filesets are not installed by default on HP Integrity. If you have installed them for some reason, they can be removed with:
/usr/sbin/swremove Jre60.JRE60-PA20 Jre60.JRE60-PA20-HS \
Jre60.JRE60-PA20W Jre60.JRE60-PA20W-HS
Using wdb to examine backtraces in Java thread stacks
You can use HP's wdb 3.0.01 or later debugger (the GDB Debugger gdb) to examine backtraces containing mixed language frames (Java and C/C++) in Java thread stacks. This simplifies debugging JVM and Java mixed-language applications.
Set the environment variable GDB_JAVA_UNWINDLIB to the path name of the Java Unwind Shared Library libjunwind, which is in the JDK. The default location of the Java Unwind Library in the JDK is:
/opt/java6/jre/lib/PA_RISC/server/libjunwind.sl
/opt/java6/jre/lib/PA_RISC2.0/server/libjunwind.sl
/opt/java6/jre/lib/PA_RISC2.0W/server/libjunwind.sl
/opt/java6/jre/lib/IA64N/server/libjunwind.so
/opt/java6/jre/lib/IA64W/server/libjunwind.so
Here are two examples setting the environment variable (in the ksh):
For 64-bit PA2.0 machines:
export GDB_JAVA_UNWINDLIB=/opt/java6/jre/lib/\
PA_RISC2.0W/server/libjunwind.sl
For 64-bit HP Integrity machines:
export GDB_JAVA_UNWINDLIB=/opt/java6/jre/lib/\
IA64W/server/libjunwind.so
If you installed the JDK in a location other than the default, substitute the non-default location for /opt/java6 in the above commands. Then use wdb as usual to debug your Java applications or core files. See the tutorial slides on debugging native and Java code with wdb at Performance Tuning, Tutorials, & Training for help on how to use the new Java stack unwind functionality.
Support for C++ applications built with -AA and -AP options (PA-RISC) only
Java supports the -AA and -AP options to build C++ applications. On HP-UX 11.11 and later releases on PA-RISC systems, C++ uses the -AP runtime option by default. If you are using the ANSI Standard C++ runtime (-AA) option in an application that loads Java, you need to use the -AA version of libjvm and libfontmanager.
These are the Standard C++ Runtime version of these libraries:
./jre/lib/PA_RISC2.0/libjvm_v2.sl
./jre/lib/PA_RISC2.0W/libjvm_v2.sl
./jre/lib/PA_RISC2.0/libfontmanager_v2.sl
./jre/lib/PA_RISC2.0W/libfontmanager_v2.sl
Any native application must be either linked with or dynamically load these versions of the Java libraries if the C++ application is compiled using -AA.
The Standard C++ version of the JVM libraries are supported for PA_RISC2.0 and PA_RISC2.0W architectures only.
If the JVM is invoked through the standard Java driver, then use the -V2 option to use the Standard C++ runtime. For example:
java -V2 <javaprog>
Using Java 2 JNI on HP-UX
For C and C++ applications, it is important to link with the -mt (multithread) option if the application calls a Java VM. Both executables and shared libraries must be linked with -mt. Use of -mt must be consistent during both compilation and linking. For more information, refer to the Native (non-Java) calling Java methods section in the Programmer's Guide.
If you embed libjvm in a 32-bit native application and wish to use a large Java heap, you must link with the -N option. Refer to the Expanding heap size in native applications on PA-RISC HP-UX 11.11 and later releases and Expanding heap size in native applications on Integrity HP-UX 11.23 and later releases for more information.
Garbage collection
For documentation about garbage collection in JDK 6 refer to http://java.sun.com/javase/technologies/hotspot/gc/gc_tuning_6.html.
Asian TrueType fonts and Asian locales
Asian locales are supported by JDK 6 with TrueType fonts. For more details, refer to HP-UX Fonts and the Java™ Runtime Environment.
Date/Time methods defaults
The HotSpot JVM uses the gettimeofday() system call to obtain date and time information. For performance reasons a new mechanism that uses the number of CPU ticks since the application started is used to calculate the current time. As a result, changes to the system date or time using the date command, adjtime() function, or time synchronization utilities such as ntp will not be reflected in the date and time that the Java program returns until the process is restarted.
If your application requires that system time changes are immediately reflected, you can use the
-XX:+UseGetTimeOfDay option to tell the JVM to use the gettimeofday call instead of the new, lightweight mechanism. However you may notice a drop in performance.
Profiling
Currently a SIGUSR2 handler to support -Xeprof profiling and a SIGPROF handler to support future profiling capability are automatically installed. This may cause incompatibilities with other native code or profiling tools which use SIGUSR2 or SIGPROF. You can turn off both handlers by using the -XX:+ReduceSignalUsage option. If you do this, be aware that this option also turns off the SIGQUIT handler, and, therefore, you will not be able to get a Java stack trace.
You can turn off just the SIGUSR2 handler by using the -Xeprof:off option, thereby retaining the ability to get a Java stack trace using SIGQUIT. For more information about -Xeprof profiling, refer to the HotSpot Technology Tools and Commands chapter of the HP-UX Programmer's Guide for Java 2 at HotSpot Technology Tools and Commands.
Compatibility with previous releases
Sun Microsystems maintains upwards compatibility. Therefore, an application written for an older JVM will run on JDK 6.0. Downward compatibility is generally not supported because new APIs are introduced that do not run on earlier JVMs.
For more information about JDK 6 compatibility with JDK 5, refer to: http://java.sun.com/javase/6/webnotes/compatibility.html.
Java Cryptography Extension (JCE) policy files
Due to import control restrictions for some countries, the Java Cryptography Extension (JCE) policy files shipped with JDK 6.0 allow strong but limited cryptography to be used. These files are located at:
<Java-home>/lib/security/local_policy.jar
<Java-home>/lib/security/US_export_policy.jar
where <Java-home> is the JRE directory of the JDK or the top-level directory of the Java SE Runtime Environment. An unlimited strength version of these files indicating no restrictions on cryptographic strengths is available on the JDK website for those living in eligible countries. Those living in eligible countries may download the unlimited strength version and replace the strong cryptography jar files with the unlimited strength files.
Unlimited strength jurisdiction policy files may be downloaded from: http://java.sun.com/javase/downloads/index.jsp.
Configuring the Runtime Plug-In
For additional information on the Runtime Plug-In, refer to the Plug-In FAQs at
Java™ Runtime Plug-in (JPI) for 1.3, 1.4, 5.0, & 6.0 Frequently Asked Questions and the Sun Java Deployment Guide for 6.0.
The JPI configuration was redesigned in the 5.0 release. For more information refer to Sun Microsystems' documentation at:
http://java.sun.com/j2se/1.5.0/docs/guide/deployment/deployment-guide/jcp.html
CLASSPATH environment variable
A user's CLASSPATH environment variable can be passed by the JVM by running the Control Panel and specifying either '-cp' or '-classpath' in the Java Run Time Parameter box. You need to exit and rerun the browser for this change to take effect.
Java Web Start technology usage
Java™ Web Start is an application-deployment technology, which gives you the power to launch full-featured applications with a single click from a web browser. It is located in the jre directory. Some of Java Web Start's features include:
- Runs independently of any browser, so you can shut down your browser or go to another web page and continue using your application.
- Applications deployed with Java Web Start do not require a browser interface to operate.
- Includes security features of the Java 2 platform.
The hardware and operating system requirements for using Java Web Start are the same as those recommended for Java SE platform implementation on which it runs.
Upgrading from a previous Java Web Start version
Do NOT uninstall your previous version of Java Web Start (if you have one) before installing the new version. Uninstalling the previous version will cause the download cache to be cleared and all of the previously installed Java Web Start applications will need to be downloaded again.
This version will overwrite previous installations and automatically update browsers to use this new release. In order to reactivate a previous version after installing this new release, you must reinstall the old version. The configuration files and program files folder used by Java Web Start have not changed, so all your settings will remain intact after the upgrade.
Additional Java Web Start documentation
More information, including developer documentation, can be found in Sun Microsystems' documentation at: http://java.sun.com/products/javawebstart/reference/index.html. Additionally, the Sun Java Deployment Guide for 6.0 at http://java.sun.com/javase/6/docs/technotes/guides/deployment/deployment-guide/contents.html also contains useful information.
Additional HP and Sun Java documentation
The following websites have additional information:
Java manpages (located at/opt/java6/man)
|