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

后端 未结 5 1879
长发绾君心
长发绾君心 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:39

    when you embed your applet in html page you have to sign the applet jar file See the documentation oracle docs

    create your certificate then use then in command prompt type the following command

    jarsigner jarfilename.jar yourcertificatename
    
    0 讨论(0)
  • 2021-01-12 12:41

    Implementing a logging solution (such as Log4j) is another option that might be worth looking at. Some quick tutorials on how to get this up and running.

    0 讨论(0)
  • 2021-01-12 12:43

    Consider enabling the Java Console which will allow you to see all the exception stack traces hopefully making it easier for you to debug.

    Also "appletviewer" is designed for testing applets outside a browser including allowing you to see the exceptions.

    0 讨论(0)
  • 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.

    0 讨论(0)
  • 2021-01-12 12:44

    It's very likely that your SecurityManager isn't allowing it.

    In FireFox, you can check the java console by going to Tools > Java Console. Firefox should already have it set up.

    0 讨论(0)
提交回复
热议问题