Eclipse Remote Debug, specially for Applet

本文介绍如何设置Java插件以允许调试器连接到Java Applet。针对JDK1.3和JDK1.5的不同配置进行了详细说明,并演示了如何使用Eclipse作为调试工具。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>

---from    Attaching a debugger to a Java Applet

I had to do this the other day, so I thought I’d pop it here for reference.

First of all, set up the Java plugin, via the Control Panel in Windows. For the JDK 1.3 plugin, navigate to the basic tab, and enter these settings in the runtime parameters box:

-Djava.compiler=NONE -Xnoagent -Xdebug -Xrunjdwp:transport=dt_socket,address=2502,server=y,suspend=n

The ‘dt_socket’ parameter here sets up a TCP port for a debugger to attach to. The 2502 can be any TCP port you like.

Settings for JDK 1.3

For JDK 1.5, its a bit different, select the Java tab in the control panel applet, and click on ‘View’. Enter the above settings in the Java runtime parameters cell.

Settings for JDK1.5

Navigate to the page with your applet in your browser. You should now be able to attach a debugger.

I use Eclipse as my Java IDE, but this should work in the likes of Netbeans and IntelliJ IDEA as well.

First of all, set some breakpoints in your application, else you won’t have much to debug ;-)

In Eclipse, select ‘Run’ and then ‘Debug…’. Create a new ‘Remote Java Application’. Select the TCP port you entered above (2502).

Eclipse debug settings (1)
Add the source for your project on the source tab.

Eclipse debug settings (2)

Click the debug button and away you go.

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值