$ javac TheJavaFile.java
(This will create a TheJavaFile.class file)
$ java TheJavaFile
(You've got two options here)
Create the manifest file say - MANIFEST.mf The MANIFEST file is nothing but an explicit entry of the Main Class
$ jar -cvfm TheJavaFile.jar MANIFEST.mf TheJavaFile.class
$ jar -cvfe TheJavaFile.jar <MainClass> TheJavaFile.class
To run the Jar File
$ java -jar TheJavaFile.jar