I have installed an application, when I try to run it (it\'s an executable jar) nothing happens. When I run it from the commandline with:
java -jar \
That is because Java cannot find the Main attribute in the MANIFEST.MF file. The Main attribute is necessary to tell java which class it should use as the application's entry point. Inside the jar file, the MANIFEST.MF file is located in META-INF folder. Wondering how you could look at what's inside a jar file? Open the jar file with WinRAR.
The main attribute inside the MANIFEST.MF looks like this:
Main-Class: .
You get this "no main manifest attribute" error when this line is missing from the MANIFEST.MF file.
It's really a huge mess to specify this attribute inside the MANIFEST.MF file.
Update: I just found a really neat way to specify the Application's entry point in eclipse. When you say Export,
Select Jar and next
[ give it a name in the next window ] and next
and next again
and you'll see " Select the class of the application entry point".
Just pick a class and Eclipse will automatically build a cool MANIFEST.MF for you.