Playback starts YouTube’s embedded player (privacy-enhanced mode).
How to Create Jar File
ChannelInternet Services and Social Networks Tutorials from HowTechDescription from the creator
Follow this step by step guide to learn how to create a jar file and see how java archive files can be created with the help of the command prompt.
Don't forget to check out our site howtech.tv/ for more free how-to videos!
youtube.com/ithowtovids - our feed
Facebook.com/howtechtv - join us on Facebook
plus.google.com/103440382717658277879 - our group in Google+
Jar stands for Java Archive which is a file format used to aggregate java classes and other resources such as images or text into one package.
We can create a jar file in several ways. For the purpose of this tutorial, we will be creating a jar file with the help of the command prompt.
Step 1 -- Open the command prompt
First of all, open the run command by pressing the "windows + r" key. Over there, type in cmd and hit the enter key in order to open the command prompt.
Step 2 -- Change the Directory
In the command prompt, go to the directory where the java classes are kept. In order to do so, type the "cd" command followed by the desired directory name.
For the purpose of this tutorial, we will go to the directory named as "java classes".
In order to check the files in this folder, enter the "dir" command. You will notice some java files present with ". java" extension in this directory. These are the files of which we are going to make a jar file.
Step 3 -- Enter the jar --cf command
Simply type the "jar - cf myfile .jar *. java" command and then hit the enter key.
In this command, jar is telling the java compiler to create jar file, cf is an attribute of create file, myfile.jar is the name of our output file and the *.java is the extension of the files which will be packed in the archive.
After done with that, simply open the directory listing again by dir command to see whether the file has been created or not. And you will notice that a file with .jar extension will appear with the same name we used in the command.
Step 4 -- View the jar file
Let us open up the directory through windows explorer, right click on the jar file and open its properties.
It can be seen that this type of the file is an Executable Jar file. And this was all about creating a jar file.
Don't forget to check out our site howtech.tv/ for more free how-to videos!
youtube.com/ithowtovids - our feed
Facebook.com/howtechtv - join us on Facebook
plus.google.com/103440382717658277879 - our group in Google+
Jar stands for Java Archive which is a file format used to aggregate java classes and other resources such as images or text into one package.
We can create a jar file in several ways. For the purpose of this tutorial, we will be creating a jar file with the help of the command prompt.
Step 1 -- Open the command prompt
First of all, open the run command by pressing the "windows + r" key. Over there, type in cmd and hit the enter key in order to open the command prompt.
Step 2 -- Change the Directory
In the command prompt, go to the directory where the java classes are kept. In order to do so, type the "cd" command followed by the desired directory name.
For the purpose of this tutorial, we will go to the directory named as "java classes".
In order to check the files in this folder, enter the "dir" command. You will notice some java files present with ". java" extension in this directory. These are the files of which we are going to make a jar file.
Step 3 -- Enter the jar --cf command
Simply type the "jar - cf myfile .jar *. java" command and then hit the enter key.
In this command, jar is telling the java compiler to create jar file, cf is an attribute of create file, myfile.jar is the name of our output file and the *.java is the extension of the files which will be packed in the archive.
After done with that, simply open the directory listing again by dir command to see whether the file has been created or not. And you will notice that a file with .jar extension will appear with the same name we used in the command.
Step 4 -- View the jar file
Let us open up the directory through windows explorer, right click on the jar file and open its properties.
It can be seen that this type of the file is an Executable Jar file. And this was all about creating a jar file.
About this tutorial
Internet Services and Social Networks Tutorials from HowTech published this 1:40 video tutorial on November 10, 2013. It has been watched 61,508 times on YouTube.
- Category
- Howto & Style
- Duration
- 1:40
- Published
- November 10, 2013
- Views
- 61,508
- Likes
- 241
Share
This tutorial in other languages
- FRComment créer le fichier Jar
- ESCómo crear archivo JAR
- PTComo criar Jar Arquivo
- ITCome creare file Jar
- DESo erstellen Jar File
- NLHoe wordt Jar bestand maken
- RUКак создать файл Jar
- PLJak utworzyć JAR Plik
- JAJARファイルを作成する方法
- ARكيفية إنشاء جرة الملف
- HIकैसे जार फ़ाइल बनाने के लिए
- IDCara Membuat Jar Berkas