0

We use a 3rd party JAR which contains an Applet class. When used in an HTML page you pass this applet the name of your 'application' class and an assets .zip file path as parameters, and the applet instantiates and runs your specified class.

I need to debug the initialization of our app when started as an applet, but since the applet class is in a JAR, not part of our source I don't know how I can do this... I can't select MyApplet.java and say "run as Applet".

I really want to be able to launch an actual HTML page with the applet parameters in, with a breakpoint set in Eclipse so it will halt in our application-class constructor. Is it possible to tell eclipse to debug an HTML file like this? A valid alternative would be to instance the Applet class in a normal Java application manually.

There are other questions about debugging applets, but this seemed a different case since the Applet isn't part of our code.

Mr. Boy
  • 60,845
  • 93
  • 320
  • 589
  • If the HTML page does not involve interacting with the applet by JS, it is not *too* difficult to create an applet context and stub that will display it in a desktop application. You can then run the desktop. app. in Eclipse and debug it. – Andrew Thompson Sep 17 '13 at 20:18
  • @AndrewThompson I actually tried that but didn't really know how to mock those classes - I tried but then applet crashed on this line in its `init()` method: `context = (AppletAppContext)AppletPlatform.getInstance().registerApp(this);` If you are able to answer how to do this I'd consider it a valid answer; there is no JS interaction at all. – Mr. Boy Sep 18 '13 at 07:15
  • Hmm.. Give [Appleteer](http://pscode.org/appleteer/) a go. See if it can load the applet successfully (or at least to the point where it breaks as you expect it to). If so, I can establish an Appleteer repository at GitHub.. – Andrew Thompson Sep 18 '13 at 07:42
  • How about [How do you debug Java Applets?](http://stackoverflow.com/questions/868111/how-do-you-debug-java-applets) and [How to Debug Bytecode with Bytecode Visualizer](http://www.drgarbage.com/how-to-debug-bytecode-with-bytecode-visualizer.html)? – zakki Sep 19 '13 at 07:13

0 Answers0