To create a jar file, you need to have java development kit (jdk) installed on your system. Open the command prompt, navigate to the folder that contains your java files and type "jar cvf filename.jar classname.java".