using JARed applets

Given the following situation:

Folder “Invaders” contains three other folders “img”, “applet”, and “game”. “applet” and “game” contain classes for my applet. The main class is in “applet”, and is called “Invaders.class”. Assume “Invaders” is located in the same folder as the jar.exe utility. I want to make a JAR for this applet.

Can someone give a step-by-step instruction on how to make the JAR and then get it to display on a web page? Sorry, I’ve seriously tried! I’ve read quite a bit of documentation on creating and using JARs, but my attempts have failed and I fear I’m missing some crucial steps along the way. Thanks in advance.

From memory:

jar cf InvadersApplet.jar -C Invaders img applet game

c - tells it to create a jar
f - tells it you’re going to specify the fie name
-C - tells it to change to the specified directory

then list the files.

This assumes that Invaders isn’t part of your package structure and is just a holder for your game stuff.

Kev

Thanks, though I have done this successfully before. However, I wasn’t able to get it to display on a web page using the JAR. I read something about declaring a main directory in the manifest - is that something I have to do?

You could add a manifest but it looks like according to this page http://java.sun.com/docs/books/tutorial/jar/basics/ you don’t actually have to.

Kev