Problems running jar files

How can I use them? Every time I try to run a jar something comes up like below:

Failed to load Main-Class manifest attribute from
C:\Documents and settings\jason\desktop\javamappy-2.2\javamappy-2.2.0\javamappy-2.2.0.jar

What the hell?

Massive-war

Well, it looks to me like your jar file’s manifest doesn’t contain a Main-Class attribute ;D

You can read about jar files [here, but the stuff pertaing to your situation is basically something like:

Jar files are just zip files containing class files with an optional manifest file. The manifest file is just a text file that contains some information about the stuff in the jar. You can read about what kind of things a manifest can contain in the tutorial trail liked above, but the one you’re interested in is the Main-Class entry, which specifies which of the bundled classes contains the main(String[] args ) method that kicks off the application. This is needed when you try and “java -jar jarFile.jar” something.

You can check the contents of a jar file by using any zip utility, or -if you know the name of the main class- you can run it with “java -cp path/to/jarFile.jar MainClass”