Yes, to run a jar, it has to exist.
While creating it, you have to match the directory structure to the package structure.
For instance, your directories might be:
/home/ellen/proj/java/foo/example/src/example/Foo.java
/home/ellen/proj/java/foo/example/src/example/util/MyList.java
for sources, and for class-files:
/home/ellen/proj/java/foo/example/classes/example/Foo.class
/home/ellen/proj/java/foo/example/classes/example/util/MyList.class
(often you find classes in a ../bin/.. instead of ../classes/.. named folder or source and class files are mixed in the same directories)
corresponding to a package structure:
package example
package example.util
then you should move to the base directory of the hierarchy:
cd /home/ellen/proj/java/foo/example/classes
or set it with the parameter -C jar -C /home/ellen/proj/java/foo/example/classes ...
or from the home jar -C proj/java/foo/example/classes ...
as relative path.
You create the jar file for example with:
jar -cf example.jar *.class
and inspect it with:
jar -tf example.jar
Note that there is a manifest file, automatically generated and useful, as a template, where you can add the information of what your main class is, if you have such, but which is pretty strict about what the syntax is (upper/lower case, line breaks).
Manifest-Version: 1.0
Created-By: 9-internal (Oracle Corporation)
Main-Class: example.Main
Such a main class entry has to be added, if you want to run it without specifying the main class:
java -jar example.jar
or else you have to use:
java -cp example.jar example.Main
In essence, a jar file is a zip archive and can be worked on with these tools.
A clean separation of src/ and bin/ files is useful, when you have more than a handful of classes and probably a deep packet structure.
jar -cf example.jar -C classes .
will then, starting in the directory classes/ include everything which is often what you want. (example/class, example/util/.class, example/net/*class ...)
jar --help
informs you about the syntax.