• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JAR

 
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...??
 
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
.
.

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic