jar file creation in java...not that tough believ me.....

go stepwise as follow in command prompt:-


jar -cvf  jarfilename .jar folder/filelist
manifest -->meta-inf 

jar -xvf jarfilename.jar


specify the main class in manifest file
Main-Class: packagename.filename
attach manifest again (create jar file again with manifest)
jar  -cvfm jarfilename.jar MANIFEST.MF folder/filelist 

java -jar jarfilename.jar arguments(if any)

if main class is not inside package , place your manifest inside the folder. go to the folder and then create your jar file
if it is in package,stay out of the package , place your manifest outside the package, create jar file staying outside the package

No comments: