Creating an executable jar:

1)Compile the code

2)Create a manifest file (probably named Manifest.txt).  The file should
contain this line "Main-Class: MyMainClass" where MyMainClass is the class
with the main that you want to run when the jar is executed.

3)Run this command from the folder containing your class files: "jar cfm
MyJarName.jar Manifest.txt *.class"

4)Chmod the jar to add executable permissions.