2 Minutes To Code (β Version)

'jar' command - 2 minute tutorial

Basic Usage : How to use 'jar' to create a jar file

Jar command is used to bundle a set of files/folders in a jar file.

Let's see the command used in the image below i.e.,

jar -cf app.jar .

Here, option -c means create a jar archive, option -f is used to specify the name of jar file. The last token in the command is . ( dot ) which stands for current directory. The jar command takes it as an instruction to bundles every file/folder in the current directory inside the jar file.