tags:

views:

134

answers:

1

Most of the tutorials around explain how to create a java applet: create a .java file with a class, compile it with javac, put the .class somewhere, add a proper tag in the html.

However, I'm not able to find anything about the best practices to build and release a complex applet, made of multiple classes and with additional libraries. How is the build/release process for this case ? What is it needed to go from my java project to the final .jar to put on the web ?

I'm working with pure Eclipse, no plugins.

+2  A: 

If you are starting a new project, do not use Applets. Applets are an old technology.

There is many new ways to replace Applets, try Java Web Start for example, here is a tutorial on how to start JWS

UPDATE
After your comment, here is how to deploy a packaged applet:
In Eclipse, create your full application usually, with at least one Applet class, lets say the full path to this class is org.test.appletproject.MyApplet, when done, from Eclipse, make Export->Jar.

Now in the HTML page, use this tag:

<applet code = 'org.test.appletproject.MyApplet' 
      archive = 'AppletProject.jar', 
      width = 500, 
      height = 500 />
medopal
Thanks but I've already enough to fight with. Old technology == solid technology. I don't want to change the world, I just need to show a trivial thing.
Stefano Borini
Updated answer with packaged jar applet example
medopal
ok that works thanks. Is this the typical way a java application is built and shipped, or does this involve creating an ant script by hand (or some tool)?
Stefano Borini
i believe most Applets applications are small. Or at least they should be. However for other applications, i.e. webapps or desktop apps, usually there is Ant or maven scripts. You could generate those with Eclipse as well
medopal