Debugging java applet in browser - works in Eclipse but not browser

后端 未结 5 1908
长发绾君心
长发绾君心 2021-01-12 12:34

I have created an applet that opens a JFileChooser to select a file on the click of a JButton. It works fine when I run it in Eclipse. When I embed

5条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-12 12:44

    Just a side note. It's rather easy to remote debug applets.

    Configure the Java plugin to allow remote debugging. You do it in different ways in different platforms, but it will be something like this on windows. Start the control panel, select java. Click around till you find VM options, and add these VM arguments:

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

    6789 will be the debug port.

    Starting the remote debugging in Eclipse is done by doing something similar to. Debug configurations, Remote Java Application, Create a new configuration. Select Standard (Socket Attach) as connection type, and enter locahost as address and 6789 as port.

提交回复
热议问题