Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to make executable Jar archive ?

 
benny rusli
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • 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.
 
Keith Lynn
Ranch Hand
Posts: 2409
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
no, i did not
 
Damanjit Kaur
Ranch Hand
Posts: 346
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic