I am new to Java, I just finished my first little project, and I would like to compile it into a JAR file. I did it from Eclipse with the Export method, I have selected my class containing the Main method, but when my JAR file is created, when I double click on it, the program just don’t run. Nothing happen, I get no error.
Here is my Manifest file, auto-generated via Eclipse:
Manifest-Version: 1.0
Main-Class: Main
Thanks in advance for helping.
You probably have external JAR dependencies that resolve just fine in Eclipse, but fail when you run the JAR from the command line. There are a couple of solutions for problems like this:
the least desirable and least portable method.
file. This is only a hair more portable than method 1), but can work
well if you bundle your applications JAR file into a ZIP, along with
all the dependent JAR’s.
them in your JAR. This is a very ugly solution but has been used by
many open source projects in the early days of Java.
with all dependencies accounted for. Somewhat proprietary but
probably your best bet.
Good luck!