File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JAR

 
Sam Bluesman
Ranch Hand
Posts: 191
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The executable class is "MainProgram" I suppose, not "AProgram", so that needs to be in the manifest.
 
Sam Bluesman
Ranch Hand
Posts: 191
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 3742
16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
.
.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic