jar file problem

W

webster

ok im having a go at creating a jar file. i am using cmd to do it. In the
folder that all my class and stuff is in i used the command "jar cf Jrum.jar
DrumMachine.class play.gif stop.gif hithat.wav snare.wav base.wav
cymbal.wav". It appears to have been successful, it made a jar file, but
when i click on it i get this message, "Java Virtual Machine Launcher,
Failed to load Main-Class manifest attribute from c:\java progs/Jrum.jar"
What does this mean? Have i don't this right? How can i over come this?
I am using "Sams teach yourself java 2" and "java 2 in easy steps" but they
are not helping.
thanks
matt
 
D

dhek bhun kho

when i click on it i get this message, "Java Virtual Machine Launcher,
Failed to load Main-Class manifest attribute from c:\java progs/Jrum.jar"
What does this mean? Have i don't this right? How can i over come this?

If you want to make the JAR to be executable through the "java -jar
<jarname>" command. Then you will need to add a Manifest file to make it
possible. It should contain a line like this:

Main-Class: my.package.MainClass

This class will be used to start the program that is contained in the JAR.

Consult the documentation on it for further information:
http://java.sun.com/j2se/1.4.1/docs/guide/jar/jar.html

You can find answers about how to write the Manifest and all other kinds
of details that are useful to understand how things work. (Like setting
the classpath and packaging several jars into a single jar)

Greets
Bhun.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top