一直以来没有写过Applet。最近在修改代码的时候设计到Applet,怎么调试呢?
网上查找了一下以下方法是可行的。转了过来。
1) First enable remote debugging in the Java Plugin:
a) Start –> Settings –> Control Panel –> Java –> Java Applet Runtime Settings –> View
b) Add the following to the “Java Runtime Parameters”:
-Djava.compiler=NONE -Xnoagent -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
2) Close all Web browser Windows
3) Put breakpoints in your source code (you need to have an Eclipse project containing the applet source code)
4) In Eclipse create a remote debugging configuration:
a) Run –> Open Debug Dialog –> Remote Java Application –> New
b) Assign host = localhost and port = 8000
Allow temination of remote VM 选择上。
然后点击Debug按钮就可以debug了。