[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[ve-dev] [OT-kinda] - Debugging Applets when running within browser
|
Off topic a bit, but I'm assuming that some of you use VE to design Applets.
I designed one recently that was really a network of applets that all
communicated with one another inside a webpage. Out of the box, you get the
standard Applet debugger in Eclipse which will allow you to debug your
applets one at a time, however if there are several applets on a webpage you
need to debug, here's how:
*Note this assumes you use the Java plugin and not the browser's native JVM
1) Create a few applets, compile them and create a webapge which has them
embedded
2) Open the Java Plug-in control panel (Start->Control Panel->Java Plugin
[in XP])
3) Switch to the Advanced tab
4) In the "Java Runtime Parameters" text box copy and paste this:
-Djava.compiler=NONE -Xnoagent -Xdebug
-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
That line tells the plugin's jvm to listen on port 8000 for remote debug
requests. Also make sure the Plug-in is using a decently new JVM (1.4.x) by
choosing one from the drop down box in the section above where you pasted
the debug information
5) In Eclipse goto Run->Debug... and click on the "Remote Java Application"
node then the New button
6) On the "Connect" tab, make sure the project field is the project which
contains the code for your applets you wish to debug.
7) Connection Type drop down will probably only allow you to choose one
type, in this case we are using "Socket Attach".
8) Connection Properties section: fill in "localhost" for Host, and "8000"
for Port. You may change the port to whatever port you wish, just make sure
that you change the "address=" string in your Plug-in's runtime parameters
to match.
9) Before you click "Debug", make sure to launch your webpage that has the
applets embedded. Ensure they are running correctly, and ensure they are
running via the Java Plug-in and not the browser's JVM. You can do this by
looking in your task tray for the Java Plug-in icon (the cup of coffee icon)
10) Hit "Debug" in Eclipse, set a breakpoint somewhere in your code, and
interact with your applet so that you can get it to execute the block of
code which has the break point.
Voila.
Any questions, email me at craiger AT tataryn DOT net
Craig.
Craig W. Tataryn
_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE*
http://join.msn.com/?page=dept/bcomm&pgmarket=en-ca&RU=http%3a%2f%2fjoin.msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca