A Java class can be stored in a jar (Java Archive) file. The classes in a jar file are stored in a compressed format, much like a zip file. A jar file is a portable container of classes. To understand how to create a jar file in Java, follow these seven steps.
cp(classpath) option. Notice that the path specified on the classpath option references the directory that contains the jar file.