• 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

How to make executable Jar archive ?

 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everybody,
i made a jar bundle package from my project, my project consists of many classes and jar package, example
1.class backup have a 6 methode and hava a depending to many jar package such as common-logging.jar, imap.jar, mail.jar, activation.java, common-net.jar, quartz.jar
2.class backup have a methode Jar,Zip,Tar,Email,JobScheduling,Brenn and the main methode. After i compiled the class backup, i got the following result
backup.class
backup$Jar.class
backup$Zip.class
backup$Tar.class
backup$Email.class
backup$JobScheduling.class
backup$Brenn.class

i use the jar tool from jdk1.5.0 with the command :
jar cf backup.jar manifest backup.class backup$Jar.class backup$Zip.class backup$Tar.class backup$Email.class backup$JobScheduling.class backup$Brenn.class
and the manifest have the following line :
Manifest-Version : 1.0
Main-Class : backup

the error is "wrong main-class", any one have idee ? i appreciated it.
 
Ranch Hand
Posts: 2412
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you put a blank line after Main-class?
 
benny rusli
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
no, i did not
 
Ranch Hand
Posts: 346
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Manifest-Version : 1.0
Main-Class : backup



I suppose,there should be no spaces between Main-Class and colon and also in the first line. There should also be one more line as

Class-Path: nameofjarfile.jar
reply
    Bookmark Topic Watch Topic
  • New Topic