aspose file tools*
The moose likes Beginning Java and the fly likes JAR Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "JAR" Watch "JAR" New topic
Author

JAR

Sam Bluesman
Ranch Hand

Joined: Nov 21, 2004
Posts: 191
I have 5 java classes that talk to each in a single directory called APRogram. I seem to be able to jar them. The command I used in Linux is:

jar cvf AProgram.jar mani.txt MainProgram.class Class1.class Class2.class Class3.class Class4.class

I have followed the instructions found on sun';s website but when i try and execute the jar file it says:

Failed to load Main-Class manifest attribute from
AProgram.jar

I did create a manifest (called mani.txt above) in the same directory that containd the lines:

Main-Class: AProgram
[carriage return]


Any ideas? Do I need to define some package or something at the top of each class file?

Cheers
[ April 26, 2006: Message edited by: Sam Bluesman ]

Moosey knows best
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42648
    
  65
The executable class is "MainProgram" I suppose, not "AProgram", so that needs to be in the manifest.


Ping & DNS - my free Android networking tools app
Sam Bluesman
Ranch Hand

Joined: Nov 21, 2004
Posts: 191
Thanks but I tired that and it still didnt work. Is there something I need ensure I have put into the actual classes themselves...??
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3739
    
  16
Try including m in your options list



Usage: jar {ctxu}[vfm0Mi] [jar-file] [manifest-file] [-C dir] files ...
Options:
.
.
-m include manifest information from specified manifest file
.
.


Joanne
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JAR