94 lines
5.8 KiB
HTML
94 lines
5.8 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" />
|
|
<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. 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. 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="debugopt.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="setbreak.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="stepping.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="debugpro" />
|
|
<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</title>
|
|
</head>
|
|
<body id="debugpro"><a name="debugpro"><!-- --></a>
|
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<h1 class="topictitle1">Debug a Java program</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. 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>If you want, you can use the interactive display of
|
|
your server to use the <samp class="codeph">*DEBUG</samp> option to view the source code
|
|
before running the program. Then, you can set breakpoints, or step over or
|
|
into a program to analyze errors while the program is running.</p>
|
|
<p>To
|
|
debug Java programs,
|
|
follow these steps:</p>
|
|
</div>
|
|
<ol><li class="stepexpand"><span>Compile the Java program by using the DEBUG option,
|
|
which is the -g option on the <samp class="codeph">javac</samp> tool. See <a href="debugopt.htm">Debug Java programs
|
|
by using the *DEBUG option</a> for more details.</span></li>
|
|
<li class="stepexpand"><span>Insert the class file (.class) and source file (.java) in the same
|
|
directory on your iSeries server.</span></li>
|
|
<li class="stepexpand"><span>Run the Java program by using the Run Java (RUNJVA)
|
|
command on the iSeries command
|
|
line. Specify OPTION(*DEBUG) on the Run Java (RUNJVA) command.</span> <p> Only
|
|
a class may be debugged. If a JAR file name is entered for the CLASS keyword,
|
|
OPTION(*DEBUG) is not supported.</p>
|
|
</li>
|
|
<li class="stepexpand"><span>The Java program source is displayed.</span></li>
|
|
<li class="stepexpand"><span>Press F6 (Add/Clear breakpoint) to set breakpoints, or press F10
|
|
(Step) to step through the program. For more information about setting breakpoints,
|
|
see <a href="setbreak.htm">Set breakpoints</a>. For details on stepping,
|
|
see <a href="stepping.htm">Step through Java programs to debug</a>.</span></li>
|
|
</ol>
|
|
<div class="section"><p><strong>Tips:</strong></p>
|
|
<ol><li>While using breakpoints and steps, check the logical flow of the Java program,
|
|
then view and change variables, as necessary.</li>
|
|
<li>Using OPTION(*DEBUG) on the RUNJVA command disables the Just-In-Time (JIT)
|
|
compiler. Files that do not have an associated Java program run in interpreted mode.</li>
|
|
</ol>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<ul class="ullinks">
|
|
<li class="ulchildlink"><strong><a href="debugopt.htm">Debug Java programs by using the *DEBUG option</a></strong><br />
|
|
Use the *DEBUG option to view the source code before running the program. The *DEBUG option allows you to set breakpoints within the code.</li>
|
|
<li class="ulchildlink"><strong><a href="setbreak.htm">Set breakpoints</a></strong><br />
|
|
The running of a program can be controlled with breakpoints. Breakpoints stop a running program at a specific statement.</li>
|
|
<li class="ulchildlink"><strong><a href="stepping.htm">Step through Java programs to debug</a></strong><br />
|
|
You can step through your program while debugging. You can either
|
|
step over or step into other functions. Java programs and native methods can use
|
|
the step function.</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> |