SEARCH HERE

Tuesday, December 27, 2022

How to make an executable jar file in Java

 

How to make an executable jar file in Java

The jar (Java Archive) tool of JDK provides the facility to create the executable jar file. An executable jar file calls the main method of the class if you double click it.

To create the executable jar file, you need to create .mf file, also known as manifest file.



Creating manifest file

To create manifest file, you need to write Main-Class, then colon, then space, then classname then enter. For example:

myfile.mf
  1. Main-Class: First  

As you can see, the mf file starts with Main-Class colon space class name. Here, class name is First.

0 comments:

Post a Comment

C++

AJAVA

C

E-RESOURCES

LKG, UKG Live Worksheets

Top