I recommend to create the jar by hand first. It will be a good sanity test, and you will learn what it takes to do it. Here are the steps:
Create a Manifest.txt
file somewhere, let's say your project root. One line is enough, like this:
Main-Class: commonDenom.UserInterface
Make sure the file ends with a newline. Eclipse doesn't put a newline at the end of the file by default. It's ok to have trailing blank lines.
Go to the parent directory where Eclipse puts your class files. For example in a Maven project this is target/classes
relative from the project root. Ant builds might use bin
instead. In your example this should be the directory that contains commonDenom
(which in turn contains the build product: UserInterface.class
)
Create the jar:
jar cfm /tmp/somename.jar /path/to/Manifest.txt commonDenom
# or probably:
jar cfm /tmp/somename.jar /path/to/Manifest.txt *
This will put your tree of class files into the jar with the specified manifest file.
Now you should be able to run this file. This can be your baseline test.
You can check the content of the jar with the command:
jar tf /tmp/somename.jar
It should print something like:
META-INF/
META-INF/MANIFEST.MF
commonDenom/UserInterface.class
... # your other class files...
Now that you have your baseline test, you can try to create the jar using Eclipse. If the jar created by Eclipse doesn't work, you can look at its content to see the differences from your baseline case, which should help you debug the problem.