how to add only the class files into jar file

hello friends,

i am trying to create a jar file which will only contain the class files gnerated. and not include te source files.

i want to also provide an Entry point to the jar file.

plz also tell me if it is fine to allow compression of the files while making jar file when am generating an 'Executable jar file'

i have class files in the follwing manner

org/vaibhav/swing/SwingDemo.class

org/vaibhav/swing/frames/StartFrame.class

org/vaibhav/swing/plaf/Plaf.class

thank you

[542 byte] By [vaibhavpinglea] at [2007-11-26 21:53:35]
# 1
http://java.sun.com/docs/books/tutorial/deployment/jar/basicsindex.html
ignignokt84a at 2007-7-10 3:47:55 > top of Java-index,Java Essentials,New To Java...
# 2

> i want to also provide an Entry point to the jar

> file.

You must create a file called "metafile" and put the following contents in it:

Main-Class: <org.vaibhav.swing.SwingDemo>

Don't forget to have a new line at the end (it failed to add the info when I missed the new line).

> plz also tell me if it is fine to allow compression

Allowing compression will not create problems. To create the jar file,

jar -cfm <jar_name>.jar metafile org/vaibhav/swing/*.class org/vaibhav/swing/frames/*.class org/vaibhav/swing/plaf/*.class

chasana at 2007-7-10 3:47:55 > top of Java-index,Java Essentials,New To Java...
# 3
may be you could have given me an example
vaibhavpinglea at 2007-7-10 3:47:55 > top of Java-index,Java Essentials,New To Java...
# 4
> may be you could have given me an exampleHai. may b u could do some work 4 yourself.Batameeze
filestreama at 2007-7-10 3:47:55 > top of Java-index,Java Essentials,New To Java...
# 5
I've given it man. What more do u need?
chasana at 2007-7-10 3:47:55 > top of Java-index,Java Essentials,New To Java...
# 6
but you are adding each folder consisting of classes , individually.....is thre no easier solution.....there ould be 10's of subfolders in an application....so writing 10 subfolders will be so uneasy
vaibhavpinglea at 2007-7-10 3:47:55 > top of Java-index,Java Essentials,New To Java...
# 7
You can use tools like ant or an IDE like NetBeans, if you want to reduce your work.
chasana at 2007-7-10 3:47:55 > top of Java-index,Java Essentials,New To Java...