command to generate jar file code example
Example 1: run jar file command line
java -jar <jar-file-name>.jar
Example 2: compile jar file command
jar cvf example.jar *
Example 3: create a JAR file containing the class file
jar cvf jar_name.jar class_you_want_in_jar.class
Example 4: run jar file
java -jar yourFile.jar