• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Executable Jar file: Not working after being embedded within a html page?

 
Kieran Shoo
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I have a small problem with my applet when embedding within a html page.

The applet works fine when ran as a Jar Executable, yet when embedded into html (Even after being signed) it throws this error...



The applet itself downloads files from an address to be loaded later from another program, without having to re-download everytime someone decides to use the other program. As stated before, running as an executable jar works perfectly fine. The applet is signed, and here is the source of a test html page to display the applet:



I don't believe there are any errors, the code will execute perfectly via executable jar or from the classes using a batch file.

Thanks for your time,
~Kieran
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The applet works fine when ran as a Jar Executable, yet when embedded into html (Even after being signed) it throws this error...

An executable jar file depends on there being a class having a main method. An applet works rather differently - it needs to extend the Applet (or JApplet) class - does your FileDownloader class do that?
 
Kieran Shoo
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:
The applet works fine when ran as a Jar Executable, yet when embedded into html (Even after being signed) it throws this error...

An executable jar file depends on there being a class having a main method. An applet works rather differently - it needs to extend the Applet (or JApplet) class - does your FileDownloader class do that?


I've fixed this now - thanks alot
 
Paul Clapham
Sheriff
Posts: 21322
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's not exactly a problem that your class has a main method. But when the browser goes to run your applet, it isn't going to call that main method. It wants to call some other methods, and that's where the problem arises. You should have a look at the Applet Tutorial to see what you should be doing instead.
 
Kieran Shoo
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ahh so instead of the main method I should be using the initialize method.

Thanks alot, i'll test to see if it works just now.
~Kieran

-Edit-

Alright, I replaced



With



However it still throws an error upon running the applet...

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic