Step1. Let your java file having the main method named 'KeyTest.java' present inside the 'jarCreator' package.
Step2. Create the Manifest file named it MANIFEST.MF (You can give any name it’s not an issue) having the line mentioned as mention below.. (copy and paste below line)
Manifest-Version: 1.0
Created-By: 1.6.0_06 (Sun Microsystems Inc.)
Main-Class: jarCreator.KeyTest
NOTE: There always should be new line(means give ENTER) after adding the Main-Class or you can say after the last entry in the manifest file.
Step3. Run command .. Open command prompt and run below coammand >>
Jar cmf MANIFEST.MF myExecutable.jar jarCreator
It will create the executable jar name “myExecuatble.jar”.
Just double click on the JAR file, it will execute the main class :)
>> If you have any issue, I will like to here from you
No comments:
Post a Comment