go stepwise as follow in command prompt:-
-verbose
create-->
jar -cvf jarfilename .jar folder/filelist
manifest -->meta-inf
extract-->
jar -xvf jarfilename.jar
running-->
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:
Post a Comment