Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
Java™ Troubleshooting Guide for HP-UX Systems: > Chapter 1 Diagnostic and Monitoring Tools and Options

-XX:OnError

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

When a fatal error occurs, the Java VM can optionally execute a user-supplied script or command. The script or command is specified using the -XX:OnError:<string> command-line option, where <string> is a single command or a list of commands each separated by a semicolon. Within <string> all occurrences of “%p” are replaced with the current process id (pid), and all occurrences of “%%” are replaced by a single “%”.

The following example shows how the fatal error report can be mailed to a support alias when a fatal error is encountered:

$ java -XX:OnError=”cat hs_err_pid%p.log|mail support@acme.com” MyApplication 

The following example shows how to execute gdb when an unexpected error is encountered. After gdb is started, it attaches to the Java VM process:

$ java -XX:OnError=”gdb - %p” MyApplication
Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 2009 Hewlett-Packard Development Company, L.P.