my dog learned polymorphism*
The moose likes Java in General and the fly likes How to make executable Jar archive ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to make executable Jar archive ?" Watch "How to make executable Jar archive ?" New topic
Author

How to make executable Jar archive ?

benny rusli
Ranch Hand

Joined: Jan 15, 2005
Posts: 72
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

Joined: Feb 07, 2005
Posts: 2367
Did you put a blank line after Main-class?
benny rusli
Ranch Hand

Joined: Jan 15, 2005
Posts: 72
no, i did not
Damanjit Kaur
Ranch Hand

Joined: Oct 18, 2004
Posts: 346
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
 
Consider Paul's rocket mass heater.
 
subject: How to make executable Jar archive ?
 
Similar Threads
Path to property file
Setting an Entry Point with JAR Tool
Finding main class problem
Jar file in jar file
Jnlp cannot find the main class in a Jar packaged using "OneJar".