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
|
<!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">
<!-- $Id: README.html 648 2002-10-28 01:50:36Z nfiedler $ -->
<head>
<meta name="generator"
content="HTML Tidy for Linux/x86 (vers 1st February 2002), see www.w3.org" />
<title>JSwat README</title>
</head>
<body>
<h1 align="center">JSwat README</h1>
<h2>What is it?</h2>
<p>JSwat is a graphical Java debugger front-end, written for the
Java 2 platform, utilizing the <a
href="http://java.sun.com/products/jpda/">Java Platform Debugger
Architecture</a> (JPDA). The source code is licensed under the <a
href="http://www.gnu.org/copyleft/gpl.html">GNU General Public
License</a>. This version of the program is maintained for
compatibility with older Java 2 releases. You may want to consider
upgrading to Java 2 version 1.4 or higher and use the latest
version of JSwat.</p>
<hr noshade="noshade" />
<h2>Requirements</h2>
<h3>J2SE</h3>
<p>JSwat requires the <a href="http://java.sun.com/j2se/">Java 2
Standard Edition</a> software, version 1.2 or higher. Compatible
software from other vendors may be used, if so desired. If you are
running J2SE version 1.4 or higher, you should use the latest
version of JSwat. It has many more features and is under constant
development.</p>
<h3>JPDA</h3>
<p>The Java Platform Debugger Architecture (JPDA) software, which
is included in most releases of the J2SE, is utilized by JSwat to
carry out its debugging activities. The required classes are
typically found in the <code><jdk>\lib\tools.jar</code> file,
and begin with the prefix <code>com.sun.jdi</code> (where JDI
stands for Java Debug Interface). These classes may also be found
in a file called <code>jpda.jar</code>.</p>
<p>To find the JPDA classes, look in the <code>lib</code> directory
of the JDK installation. If there is a <code>jpda.jar</code> file
there, then you have the JPDA and you can skip all of these steps.
If, instead, there is a <code>tools.jar</code> file, there is a
chance that it contains the JPDA classes. Scan the output from
<code>jar tf tools.jar</code> and look for the
"<code>com/sun/jdi</code>" classes. If you see them, then
your <code>tools.jar</code> file contains the JPDA classes.
Otherwise you need to download the <a
href="http://www.javasoft.com/products/jpda/">JPDA</a>.</p>
<p><strong>Linux JDK 1.2.2 users:</strong><br />
Yes, it seems that the JPDA is not included with the Linux JDK
version 1.2.2, despite what the web site may tell you. Download the
Sun SPARC version and extract just the <code>jpda.jar</code> file
and copy it to the <code>lib</code> directory of your JDK
installation. You will also need to follow the JPDA installation
instructions. The important step is to add
<code><jdk_home>/lib/i386</code> to your
<code>LD_LIBRARY_PATH</code> setting. If you fail to do this, you
will see the "can't find libjdwp.so" error message
when using JSwat.</p>
<h3>Debugging Info</h3>
<p>JSwat, like most Java debuggers, requires that the classes to be
debugged be compiling using the <code>-g</code> flag. In addition,
do not compile the classes with the optimization flags, as that may
hinder debugging.</p>
<hr noshade="noshade" />
<h2>Starting JSwat</h2>
<p>There are several ways to start JSwat, but we will only cover
the simplest of these for now.</p>
<blockquote>
<code>java -Djava.ext.dirs=<JAVA_HOME>\lib -jar
<JSWAT_HOME>\jswat.jar</code>
</blockquote>
<blockquote>
<em>Unix users must replace <code>\</code> with <code>/</code> in
the line above.</em>
</blockquote>
<p>Note that <code>JAVA_HOME</code> is the path to the JDK, while
<code>JSWAT_HOME</code> is the path to the <code>jswat.jar</code>
file. The <code><JAVA_HOME>\lib</code> directory must contain
the <code>tools.jar</code> (or <code>jpda.jar</code>) file in order
for JSwat to start. This file contains the JPDA classes
(<code>com.sun.jdi</code>) used by JSwat. If the file containing
these classes is located elsewhere in your system, you must make
the appropriate change to the command used to invoke JSwat.</p>
<h3>Passing Arguments</h3>
<p>JSwat can accept a string of commands to be executed as soon as
it has completed its startup. These commands are passed at the end
of the command line used to start the program. Here are some
examples:</p>
<ul>
<li><code>java ... jswat.jar load -client MyClass arg1
arg2</code></li>
<li><code>java ... jswat.jar attach mymachine:1234</code></li>
<li><code>java ... jswat.jar "load MyClass; stop
MyClass:120; resume"</code></li>
</ul>
<p>Read the help section titled "Commands" to learn more
about using JSwat commands.</p>
<h3>Other Ways to Start JSwat</h3>
<ol>
<li>
<div>
As an alternative to using the Java Extensions Mechanism, you
may invoke JSwat like so:
</div>
<pre>
java -Xbootclasspath/a:<JAVA_HOME>\lib\tools.jar -jar <JSWAT_HOME>\jswat.jar
</pre>
</li>
<li>
<div>
For a shorter invocation, list the aforementioned
<code>tools.jar</code> file and the JSwat jar files in your
classpath and invoke the program with this simple command:
</div>
<pre>
java com.bluemarsh.jswat.Main
</pre>
</li>
<li>
<div>
Another short invocation can be accomplished by copying the
<code>tools.jar</code> file to the
<code><JAVA_HOME>\jre\lib\ext</code> directory, then
starting JSwat like so:
</div>
<pre>
java -jar <JSWAT_HOME>\jswat.jar
</pre>
<p>Note that the <code>-jar</code> option causes the classpath
setting to be ignored. This includes the path following the
<code>-cp</code> or <code>-classpath</code> options, as well as
the <code>CLASSPATH</code> environment variable.</p>
</li>
</ol>
<hr noshade="noshade" />
<h2>Documentation</h2>
<p>The JSwat documentation is found in the <code>docs</code>
directory. Additionally, there are several "how to"
documents and a tutorial on the <a
href="http://www.bluemarsh.com/java/jswat/docs/">web site</a>.</p>
<hr noshade="noshade" />
<h2>Stopping JSwat</h2>
<h3>Do not use Ctrl-C to exit!</h3>
<p>Using Ctrl-c to exit a program is generally incorrect. It is
especially incorrect with JSwat. You can expect things to break if
you do this. It must <em>only</em> be used in cases where the JVM
hosting JSwat has frozen. The correct way to exit JSwat is via
either the window close button, the <code>exit</code> command, or
the Exit item in the File menu.</p>
<hr noshade="noshade" />
<h2>Removing JSwat</h2>
<p>Removing JSwat from your system is generally pretty simple. Find
the files, wherever it is that you originally put them, and delete
them. If, on the other hand, you used one of the packaged versions
such as RPM or DEB, you will need to remove the package using the
appropriate tool.</p>
<p>To remove all traces of JSwat from your system, you will need to
look in only one place. Find your home directory and remove the
<code>.jswat</code> directory found there.</p>
<hr noshade="noshade" />
<h2>Getting the latest source</h2>
<p>The latest source code can be found in the Subversion repository
at <code>http://www.bluemarsh.com/repos/jswat/1_x</code> using any
web browser, or a <a
href="http://subversion.tigris.org/">Subversion</a> client. See the
<a
href="http://www.bluemarsh.com/java/jswat/contrib.html">contributing</a>
page on the JSwat web page for more information about using
Subversion to access the repository.</p>
<hr noshade="noshade" />
<h2>Platform Particulars</h2>
<p>Below are notes concerning particular platforms and what must be
done to make JSwat work correctly on them.</p>
<h3>Mac OS X</h3>
<p>According to a Mac OS X 10.1.5 user, it is necessary to add the
hostname of your machine to the <code>netinfo</code> file.
Otherwise you will see an error about <code>gethostbyname</code>
when launching the debuggee. This is because the JPDA uses sockets
to communicate between JSwat and the debuggee, even when the
debuggee is launched by JSwat.</p>
<h3>Windows</h3>
<p>The JRE, often installed with the JDK, seems to cause more
problems than it solves. If JSwat tells you that the JPDA cannot be
found and you are certain you followed the instructions above
correctly, then chances are the JRE is getting in the way. I
recommend saving yourself time and trouble and removing the JRE
from your system. If you cannot do this, then at least delete or
rename the <code>java.exe</code> and <code>javaw.exe</code> files
in the Windows directory.</p>
<h3>Windows NT and JDK 1.4</h3>
<p>There seems to be a problem with using JDK 1.4 on Windows NT
4.0, relating to the DirectX features. The errors occur in the
method <code>sun.awt.windows.Win32DDRenderer.doFillRectDD</code>.
The solution appears to be quite simple, just add the following
option after <code>java</code> when starting JSwat:
<code>-Dsun.java2d.noddraw=true</code></p>
</body>
</html>
|