1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator"
content="HTML Tidy for Linux/x86 (vers 1st February 2002), see www.w3.org" />
<title>JSwat - Frequently Asked Questions</title>
<link href="http://www.bluemarsh.com/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!-- body table -->
<table summary="formatting" valign="top" border="0" cellpadding="8"
cellspacing="0" width="100%">
<!-- start header -->
<tr>
<td colspan="2">
<!-- start title -->
<table summary="table" align="center" bgcolor="#000000"
border="0" cellpadding="1" cellspacing="0" width="100%">
<tr>
<td>
<table summary="table" bgcolor="#ffffff" border="0"
cellspacing="0" width="100%">
<tr>
<td width="10%" align="center">
<img src="http://www.bluemarsh.com/images/cattails.jpg" alt="cattails">
</td>
<td align="left">
<h1>Blue Marsh Softworks</h1>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- end title -->
</td>
</tr>
<!-- end header -->
<tr>
<!-- left column -->
<td valign="top" width="20%">
<!-- start sidebox -->
<table summary="table" bgcolor="#000000" border="0" cellpadding="0"
cellspacing="0" width="100%">
<tr>
<td>
<table summary="table" border="0" cellpadding="3" cellspacing="1"
width="100%">
<tr>
<td bgcolor="#CCCCCC"> <span class="title">Site
Index</span></td>
</tr>
<tr>
<td bgcolor="#ffffff"> <span class="small">o</span> <a
class="nav" href="http://www.bluemarsh.com/java/index.html">java projects</a><br>
<span class="small">o</span> <a class="nav" href=
"http://www.bluemarsh.com/personal/index.html">about me</a><br>
<span class="small">o</span> <a class="nav" href=
"http://www.bluemarsh.com/htdig/search.html">search</a><br>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- end sidebox -->
<br />
<!-- start links -->
<table summary="table" bgcolor="#000000" border="0" cellpadding="0"
cellspacing="0" width="100%">
<tr>
<td>
<table summary="table" border="0" cellpadding="3" cellspacing="1"
width="100%">
<tr>
<td bgcolor="#CCCCCC"> <span class="title">My Java
</span></td>
</tr>
<tr>
<td bgcolor="#ffffff"> <span class="small">o</span> <a
class="nav" href="http://www.bluemarsh.com/java/tips.html">java tips</a><br>
<span class="small">o</span> <a class="nav" href=
"http://www.bluemarsh.com/java/faq.html">java faq</a><br>
<span class="small">o</span> <a class="nav" href=
"http://www.bluemarsh.com/java/contrib.html">contributing</a><br>
</td>
</tr>
<tr>
<td bgcolor="#CCCCCC"> <span class="title">General
Java</span></td>
</tr>
<tr>
<td bgcolor="#ffffff"> <span class="small">o</span> <a
class="nav" href="http://java.sun.com/">JavaSoft</a><br>
<span class="small">o</span> <a class="nav" href=
"http://developer.java.sun.com/">Developer Connection</a><br>
<span class="small">o</span> <a class="nav" href=
"http://www.afu.com/javafaq.html">The Java FAQ</a><br>
<span class="small">o</span> <a class="nav" href=
"http://mindprod.com/jgloss.html">Java Glossary</a><br>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- end links -->
<br />
<!-- start links -->
<table summary="table" bgcolor="#000000" border="0" cellpadding="0"
cellspacing="0" width="100%">
<tr>
<td>
<table summary="table" border="0" cellpadding="3" cellspacing="1"
width="100%">
<tr>
<td bgcolor="#CCCCCC"> <span class="title">JSwat</span></td>
</tr>
<tr>
<td bgcolor="#ffffff"> <span class="small">o</span> <a
class="nav" href=
"http://sourceforge.net/project/showfiles.php?group_id=59085">
downloads</a> <span class="nav">[sf.net]</span></a><br>
<span class="small">o</span> <a class="nav" href=
"../download.html">other downloads</a><br>
<span class="small">o</span> <a class="nav" href=
"index.html">documentation</a><br>
<span class="small">o</span> <a class="nav" href=
"faq.html">faq</a><br>
<span class="small">o</span> <a class="nav" href=
"../mail-lists.html">mailing lists</a><br>
<span class="small">o</span> <a class="nav" href=
"../integrate.html">integrating</a><br>
<span class="small">o</span> <a class="nav" href=
"../contrib.html">contributing</a><br>
<span class="small">o</span> <a class="nav" href=
"http://www.bluemarsh.com/bugzilla/">bugs</a><br>
</td>
</tr>
<tr>
<td bgcolor="#CCCCCC"> <span class="title">Related
Software</span></td>
</tr>
<tr>
<td bgcolor="#ffffff">
<span class="small">o</span> <a class="nav" href=
"http://www.eclipse.org/">Eclipse</a><br>
<span class="small">o</span> <a class="nav" href=
"http://www.oops.demon.co.uk/jdbtool/">JDBTool</a><br>
<span class="small">o</span> <a class="nav" href=
"http://jdee.sunsite.dk/">JDEE</a><br>
<span class="small">o</span> <a class="nav" href=
"http://sourceforge.net/projects/jenus/">Jenus</a><br>
<span class="small">o</span> <a class="nav" href=
"http://jipe.sourceforge.net/">Jipe</a><br>
<span class="small">o</span> <a class="nav" href=
"http://java.sun.com/products/jpda/">JPDA</a><br>
<span class="small">o</span> <a class="nav" href=
"http://www.netbeans.org/">NetBeans</a><br>
</td>
</tr>
<tr>
<td bgcolor="#CCCCCC"> <span class="title">Related
Links</span></td>
</tr>
<tr>
<td bgcolor="#ffffff">
<span class="small">o</span> <a class="nav"
href="http://freshmeat.net/projects/jswat/">FreshMeat listing</a><br>
<span class="small">o</span> <a class="nav"
href="http://sourceforge.net/projects/jswat/">SourceForge page</a><br>
<span class="small">o</span> <a
class="nav" href="http://www.skylit.com/javamethods/nodebugger.html">
Top Ten Reasons Not to Use a Java Debugger in School</a><br>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- end links -->
</td>
<td valign="top" width="75%">
<table summary="formatting" border="0" cellpadding="0"
cellspacing="0" width="100%">
<tr>
<td valign="top" width="100%">
<!-- start content -->
<table summary="formatting" align="center" bgcolor=
"#000000" border="0" cellpadding="0" cellspacing="0"
width="100%">
<tr>
<td>
<table summary="formatting" border="0"
cellpadding="8" cellspacing="1" width="100%">
<tr>
<td bgcolor="#ffffff">
<h3>Frequently Asked Questions</h3>
<p>The following are a list of frequently asked questions
about JSwat. You may want to check out <a
href="http://www.bluemarsh.com/java/faq.html">my Java FAQ</a> page as well.</p>
<h3>About Questions</h3>
<ol>
<li><span class="copy"><strong>How is JSwat used? What is
the JPDA and what role does it play?</strong><br />
JSwat is a Java application which utilizes the classes
provided in the <a
href="http://java.sun.com/products/jpda/">Java Platform
Debugger Architecture</a>. JPDA provides the back-end
support for debugging Java classes. To use JSwat you will
need a JDK and the JPDA installed on your system. See the
<code>README.html</code> file distributed with JSwat for
the details.</span></li>
<li><span class="copy"><strong>Which version of the JDK and
JPDA should I be using to run JSwat?</strong><br />
The README file contained in each release explains the
detailed requirements information. In a nutshell, the 1.x
versions of JSwat require JDK 1.2 or better, while the 2.x
versions require JDK 1.4 or better.</span></li>
</ol>
<h3>Setting Up, Starting Questions</h3>
<ol>
<li><span class="copy"><strong>When I start JSwat I get an
error about the JIT compiler.</strong><br />
You generally should not debug Java code with the JIT
compiler turned on. You can turn off the JIT compiler by
passing the "<code>-Djava.compiler=NONE</code>"
switch to <code>java</code> when starting your application.
You could also define the environment variable
<code>JAVA_COMPILER</code>, setting its value to
"NONE". JDK 1.4 and later do not support the
flags described above. Instead, ensure that the HotSpot
flags are not being used when launching the debuggee
(<code>-client</code>, <code>-hotspot</code>, or
<code>-server</code>).</span></li>
<li><span class="copy"><strong>When I start JSwat and try
to load a class to debug, I get the error
"<code>can't load
'jdwp.dll'</code>".</strong><br />
You need to make sure the JPDA <code>'lib'</code>
directory is in your <code>PATH</code> environment
variable. In this case, the <code>'jdwp.dll'</code>
file is missing from your <code>PATH</code> and the JVM
cannot find the file when JPDA initializes. Locate the
directory containing the <code>'jdwp.dll'</code>
file and make sure it is in your
<code>PATH</code>.</span></li>
<li><span class="copy"><strong>When I start JSwat and try
to load a class to debug, I get the error
"<code>can't load
'libjdwp.so'</code>".</strong><br />
You need to make sure the JPDA
<code>'lib/i386'</code> or
<code>'lib/sparc'</code> directory is in your
<code>LD_LIBRARY_PATH</code> environment variable. In this
case, the <code>'libjdwp.so'</code> file is missing
from your <code>LD_LIBRARY_PATH</code> and the JVM cannot
find the file when JPDA initializes. Locate the directory
containing the <code>'libjdwp.so'</code> file and
make sure it is in your
<code>LD_LIBRARY_PATH</code>.</span></li>
<li><span class="copy"><strong>When I try to start JSwat
like so "java -jar jswat.jar", it fails, printing
the message "Missing JPDA
package."</strong><br />
Please read the <code>README.html</code> file included
with JSwat for the instructions on how to start the
program.</span></li>
<li><span class="copy"><strong>When I launch my program in
JSwat it has problems, but it runs fine without
JSwat.</strong><br />
If you are running on a Windows platform, try the steps
given <a
href="http://www.bluemarsh.com/java/faq.html#win32jdk">here</a>,
under the heading of the "JDK versus
JRE".</span></li>
</ol>
<h3>Using Questions</h3>
<ol>
<li><span class="copy"><strong>When I type 'resume'
to begin running my program from within JSwat, the debugger
seems to hang.</strong><br />
You are probably running the HotSpot VM in JDK 1.3 on
Linux. The HotSpot VM in JDK 1.3 is not very good for
debugging and you should use the Classic VM instead. See
the <a href="howto-classicvm.html">Run Classic VM</a>
page.</span></li>
<li><span class="copy"><strong>When I try to start my
debuggee class with the "<code>load
myClass</code>" command, it fails, saying the debuggee
VM exited.</strong><br />
If you check the "Output" panel in the JSwat
window. You will probably see a message that says the class
was not found. You need to set the classpath properly
before launching the debuggee.</span></li>
<li><span class="copy"><strong>When I single step over a
method that attempts to read input from the standard input,
the call hangs.</strong><br />
Press the Refresh button and that will unblock JSwat. For
some reason on green threaded systems, JSwat hangs when
attempting to send input to the debuggee VM. It works fine
on Windows systems and in JDK 1.4 and later.</span></li>
<li><span class="copy"><strong>The thread status seems to
always say "UNKNOWN".</strong><br />
This seems to happen with older HotSpot VMs. Try running
JSwat and your debuggee VM with the Classic VM (see the <a
href="howto-classicvm.html">Run Classic VM</a>
page).</span></li>
<li><span class="copy"><strong>Debugging seems very slow,
especially the startup time of my program.</strong><br />
Are you running the HotSpot VM on a JDK earlier than 1.4?
If so, turn it off. It can greatly affect the run time of
your program during debugging. See the <a
href="howto-classicvm.html">Run Classic VM</a> page. In JDK
1.4 and later, the HotSpot VM is the only VM available.
Make sure you are <em>not</em> using any of the HotSpot
flags (<code>-client</code>, <code>-hotspot</code>, or
<code>-server</code>). You might also try remotely
debugging your program. Start the program and attach to it
remotely after it has completed its startup. This is
described in the help files provided with
JSwat.</span></li>
<li><span class="copy"><strong>I cannot get JSwat to show
me the values of any variables. It seems that JSwat thinks
there is "no variable information for that
class".</strong><br />
Recompile your classes with the <code>-g</code> option.
This generates the debugging information when the compiler
creates the <code>.class</code> files. This is necessary
for any Java debugger that you would use.</span></li>
<li><span class="copy"><strong>Some local variables seem to
be invisible to the debugger. The code compiles and runs
fine, but the debugger is unable to display the
variables.</strong><br />
It is unclear if the Java compiler or the Java VM is at
fault here. Either way, the solution tends to be the same
-- assign an initial value to the variable when you define
it. That is, instead of "<code>String s1;</code>"
you would write "<code>String s1 = null;</code>".
This makes the variable visible to the
debugger.</span></li>
<li><span class="copy"><strong>JSwat tells me that it
cannot find my source files. Why is that?</strong><br />
JSwat uses the classpath and sourcepath to locate source
files. Check that these are set with appropriate values.
Read the Classpath and Sourcepath help topic to learn all
about the classpath and sourcepath.</span></li>
<li><span class="copy"><strong>JSwat complains about a
parser error when it reads my source files.</strong><br />
Typically this is caused by use of the string
"assert" in a fashion that does not denote a
keyword. JSwat 2.x treats "assert" as a keyword
and so any methods or variables with that name are treated
as a parser error. Your only options are to conform to the
latest JLS standard or switch back to a 1.x version of
JSwat, which does not treat "assert" as a
keyword. If you are seeing the parser error for some other
reason, please email me a sample bit of code so I can
investigate the problem further.</span></li>
<li><span class="copy"><strong>I am getting "Exception
thrown... CharToByteSingleByte.convert" when I launch
the debuggee from within JSwat.</strong><br />
You are probably running a Unix-like system and are
missing the URW fonts. See <a
href="http://www.gimp.org/fonts.html">http://www.gimp.org/fonts.html</a>
for the freely available URW fonts.</span></li>
</ol>
<h3>Breakpoint Questions</h3>
<ol>
<li><span class="copy"><strong>Setting breakpoints seems to
be failing.</strong><br />
Older versions of HotSpot seem to have a couple of major
flaws, handling breakpoints is one of them. Try running
JSwat and your debuggee VM with the Classic VM (see the <a
href="howto-classicvm.html">Run Classic VM</a>
page).</span></li>
<li><span class="copy"><strong>I am having trouble setting
breakpoints in a particular class. It seems that JSwat
thinks there is "no line number
information".</strong><br />
This may be caused by the Java compiler. If you are using
jikes, it could be generating invalid debugging
information. Try using the Java compiler that comes with
the JDK. Additionally, I have found that deleting all the
class files and recompiling will sometimes
help.</span></li>
<li><span class="copy"><strong>I keep getting "no code
at that line" messages when starting the
debuggee.</strong><br />
This is likely caused by a breakpoint that was set on a
line of code that has moved to another line. That is, you
set a breakpoint at line X, then modified the code so that
the code at X is now at Y. Meanwhile JSwat keeps trying to
resolve the breakpoint at line X. Simply delete or edit the
breakpoint specification to resolve this issue.</span></li>
</ol>
<h3>Console Questions</h3>
<ol>
<li><span class="copy"><strong>When using JSwat via the
console mode, I cannot enter very long commands, such as to
set a long classpath. It seems to limit to 256
characters.</strong><br />
It seems that on Solaris, the terminal driver is set to
only allow canonical input lines of up to 256 characters.
You may need to use a different terminal emulator or
command interpreter to avoid this issue.</span></li>
<li><span class="copy"><strong>How can I clear the screen,
like the DOS "cls" command?</strong><br />
Define a "cls" alias like so: <code>alias cls
100 stdout</code>. Anytime you invoke the cls alias, 100
blank lines will be printed. The alias will be persisted
indefinitely, so you only need to define it
once.</span></li>
</ol>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- end content -->
</td>
</tr>
</table>
</td>
<!-- end right column -->
</tr>
<!-- start footer -->
<tr>
<td align="center" colspan="2">
<span class="footer">© Copyright 2000-2002 -
<a href="http://www.bluemarsh.com/index.html">Blue Marsh Softworks</a></span>
</td>
</tr>
<!-- end footer -->
</table>
</body>
</html>
|