How to generate jar file from Java class

You can generate jar file with three simple commands:

Firstly you need to compile the code that you have written with this command:

Generate the jar file with the class files that were generated with the previous command:

Note that if you don’t have the manifest file already you can create it simply by using the following content for the file:

Now you can test your jar file:

Leave a Reply

Your email address will not be published. Required fields are marked *