How do I debug an applet remotely?
- You should have properly installed Java Plug-in. Plugin is a part of Java Runtime Environment (JRE).
- Start Java Plug-in Properties (Start > Settings > Control Panel > Java)
- Select Java tab and in the Java Applet Runtime Settings area, click View.
- Open Java Control Panel. Click Java > Java AppletRuntime Settings > View. Specify the following parameters in the Java Runtime Parameters with each parameter separated by a comma as follows: -agentlib:jdwp=transport=dt_shmem,address=jdbconn,server=y,suspend=n
- Open html page with applet in your web browser (Mozilla/Internet Explorer/...).
- From main menu invoke Debug | Attach Debugger (in NetBeans 6.1 older Run | Attach Debugger) and set:
- Debugger: JPDA Debugger
- Connector: SharedMemoryAttach
- Name: jdbconn
- NetBeans debugger should be connected to the VM used by your web browser now and should be ready to stop on breakpoints.
When debugging applets in Java Plug-in, make sure that only one instance of the browser is being used for debugging using the same connection address at the same time. Otherwise, it will result in a conflict, since the Java Runtime for each instance of the browser will try to gain exclusive access to the connection address. To debug applets in both Internet Explorer and supported Mozilla browsers, run either Internet Explorer or supported Mozilla browsers with Java Plug-in—but not both at the same time.
More info about plug-in development you can find inside Java plug-in Developer Guide
Applies to: NetBeans 5.x, 6.x