Click to See Complete Forum and Search --> : jar command troubles
crazycoder
03-04-2006, 02:39 PM
I made a program that will list the Fibonacci numbers. I compiled it fine, and it runs great, but it won't get into a jar file. All my files are in the folder junk: manifest.mf, FibonacciSequence.class. I use this command: jar cfm FibonacciNumbers.jar manifest.mf FibonacciSequence.classIt does that fine but when I double click it, it says, Failed to load Main-Class attribute from ... This is my manifest file: Main-Class: FibancciSequenceI don't know what is happening, but it is really weird, because I think I'm doing everything correctly.
Khalid Ali
03-04-2006, 08:48 PM
first of all if its not a typo then the class name for main class is wrong.
Second you will need to make sure that after every line there is a crriage return in the manifest.
last but not the least use some tool to convert ur manifest file from dos to unix style so that there are not BOM characters in it....And must read manifest file specs to make sure required values are there
jetbrains
03-05-2006, 07:43 AM
jar cvf FibonacciNumbers.jar manifest.mf FibonacciSequence.class
or
jar cvf demo.jar .
JAVA FREE CHART TUTORIAL EBOOKS SOURCE CODE (http://www.javaresources.biz/)
crazycoder
03-05-2006, 12:00 PM
Okey Dokey. Thank you!
crazycoder
03-21-2006, 05:14 PM
Now I can get it to work with it not giving me any error at all but it won't run the program.
Manifest-Version: 1.0
Main-Class: FibonacciSequence
X-COMMENT: by Samuel Ainsworth
Y-COMMENT: bob@revengeofthekillersnowgoons.com
jar cfm hoopla.jar manifest.mf fibonaccisequence.class
Mr. Ram
03-21-2006, 11:02 PM
Generally, I am creating the war file as follows :
jar -cvf AppName.war .
crazycoder
03-24-2006, 06:36 PM
What's a .war file type? Never heard of it.
Khalid Ali
03-24-2006, 08:31 PM
Its just a java zip file that contains web application contents in it.
crazycoder
03-25-2006, 04:09 PM
So, is that exactly what I should put in the command line? It never has class files or the manifest. Excuse my slight lack of nolege. I guess that's why everyone says to stay in skool.