113 lines
6.9 KiB
HTML
113 lines
6.9 KiB
HTML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE html
|
|
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html lang="en-us" xml:lang="en-us">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<meta name="security" content="public" />
|
|
<meta name="Robots" content="index,follow" />
|
|
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
|
|
<meta name="DC.Type" content="task" />
|
|
<meta name="DC.Title" content="Debug a Java program from another display" />
|
|
<meta name="abstract" content="The easiest way to debug Java programs that run on your iSeries server is to use the IBM iSeries System Debugger. The IBM iSeries System Debugger provides a graphical user interface that enables you to more easily use the debugging capabilities of your iSeries server." />
|
|
<meta name="description" content="The easiest way to debug Java programs that run on your iSeries server is to use the IBM iSeries System Debugger. The IBM iSeries System Debugger provides a graphical user interface that enables you to more easily use the debugging capabilities of your iSeries server." />
|
|
<meta name="DC.Relation" scheme="URI" content="debug.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="qibmenv.htm" />
|
|
<meta name="copyright" content="(C) Copyright IBM Corporation 2006" />
|
|
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2006" />
|
|
<meta name="DC.Format" content="XHTML" />
|
|
<meta name="DC.Identifier" content="debother" />
|
|
<meta name="DC.Language" content="en-us" />
|
|
<!-- All rights reserved. Licensed Materials Property of IBM -->
|
|
<!-- US Government Users Restricted Rights -->
|
|
<!-- Use, duplication or disclosure restricted by -->
|
|
<!-- GSA ADP Schedule Contract with IBM Corp. -->
|
|
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
|
|
<link rel="stylesheet" type="text/css" href="./ic.css" />
|
|
<title>Debug a Java program from another display</title>
|
|
</head>
|
|
<body id="debother"><a name="debother"><!-- --></a>
|
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<h1 class="topictitle1">Debug a Java program from another display</h1>
|
|
<div><p>The easiest way to debug Java™ programs that run on your iSeries™ server
|
|
is to use the IBM<sup>®</sup> iSeries System
|
|
Debugger. The IBM iSeries System
|
|
Debugger provides a graphical user interface that enables you to more easily
|
|
use the debugging capabilities of your iSeries server.</p>
|
|
<div class="section"><p>For more information about using the iSeries System Debugger to debug and
|
|
test Java programs
|
|
that run on your iSeries server,
|
|
see <a href="../rzamq/rzamqmain.htm" target="_blank">IBM iSeries System
|
|
Debugger</a>.</p>
|
|
<p>When debugging a Java program by using the interactive display
|
|
of your server, the program source displays whenever it encounters a breakpoint.
|
|
This may interfere with the display output of the Java program. To avoid this, debug the Java program
|
|
from another display. The output from the Java program displays where the Java command
|
|
is running and the program source shows on the other display.</p>
|
|
<p>It is
|
|
also possible to debug an already running Java program in this manner as long as it
|
|
is not using the <a href="jit.htm">Just-In-Time (JIT) compiler</a>.</p>
|
|
<p>To
|
|
debug Java from
|
|
another display, do the following:</p>
|
|
</div>
|
|
<ol><li class="stepexpand"><span>The Java program must be held, while you start setting up
|
|
to debug.</span> <div class="p">You can hold the Java program by making the program: <ul><li>Wait for input from the keyboard.</li>
|
|
<li>Wait for a time interval.</li>
|
|
<li>Loop to test a variable, which requires that you set a value to eventually
|
|
get the Java program out of the loop.</li>
|
|
</ul>
|
|
</div>
|
|
</li>
|
|
<li class="stepexpand"><span>Once the Java program is held, go to another display
|
|
to perform these steps: </span><ol type="a"><li><span>Enter the Work with Active Jobs (WRKACTJOB) command on the command
|
|
line.</span></li>
|
|
<li><span>Find the batch immediate (BCI) job where your Java program
|
|
is running. Look under the Subsystem/Job listing for QJVACMDSRV. Look under
|
|
the User listing for your User ID. Look under Type for BCI.</span></li>
|
|
<li><span>Enter option 5 to work with that job.</span></li>
|
|
<li><span>At the top of the Work with Job display, the Number, User, and
|
|
Job are displayed. Enter <samp class="codeph">STRSRVJOB Number/User/Job</samp>.</span></li>
|
|
<li><span>Enter <samp class="codeph">STRDBG CLASS(classname)</samp>. Classname is
|
|
the name of the Java class that you want to debug. It can either be
|
|
the class name that you specified on the Java command, or it can be another class.</span></li>
|
|
<li><span>The source for that class appears in the Display Module Source
|
|
display.</span></li>
|
|
<li><span>Set breakpoints, by pressing F6 (Add/Clear breakpoint), whenever
|
|
you would like to stop in that Java class. Press F14 to add other classes,
|
|
programs, or service programs to debug. For more information about setting
|
|
breakpoints, see <a href="setbreak.htm">Set breakpoints</a>.</span></li>
|
|
<li><span>Press F12 (Resume) to continue running the program.</span></li>
|
|
</ol>
|
|
</li>
|
|
<li class="stepexpand"><span>Stop holding your original Java program. When the breakpoints are hit,
|
|
the Display Module Source display appears on the display where the Start Service
|
|
Job (STRSRVJOB) command and the Start Debug (STRDBG) command were entered.
|
|
When the Java program ends, a <samp class="codeph">Job being serviced ended</samp> message
|
|
appears.</span></li>
|
|
<li class="stepexpand"><span>Enter the End Debug (ENDDBG) command.</span></li>
|
|
<li class="stepexpand"><span>Enter the End Service Job (ENDSRVJOB) command.</span></li>
|
|
</ol>
|
|
<div class="section"><div class="note"><span class="notetitle">Note:</span> Ensure that you disable the Just-In-Time (JIT) when starting
|
|
the Java virtual
|
|
machine in the original job. This can be done with the <samp class="codeph">java.compiler=NONE</samp> property.
|
|
If the JIT runs while debugging, unexpected results may occur.</div>
|
|
<p>See <a href="qibmenv.htm">QIBM_CHILD_JOB_SNDINQMSG environment variable</a> for
|
|
more information about this variable that controls whether the BCI job waits
|
|
before calling the Java virtual machine.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<ul class="ullinks">
|
|
<li class="ulchildlink"><strong><a href="qibmenv.htm">QIBM_CHILD_JOB_SNDINQMSG environment variable</a></strong><br />
|
|
The QIBM_CHILD_JOB_SNDINQMSG environment variable is the variable
|
|
that controls whether the batch immediate (BCI) job, where the Java virtual
|
|
machine runs, waits before starting the Java virtual machine.</li>
|
|
</ul>
|
|
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="debug.htm" title="To debug Java programs from the i5/OS command line, select one of the options listed here.">Debug Java programs from an i5/OS command line</a></div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |