views:

293

answers:

1

Hi,

I'm trying to run a .jar file with the command "java -jar Filename.jar", but I am always getting an error saying "Could not find the main class: bla.bla.yada". I build the whole application with Maven and specified a Main-Class in the MANIFEST.MF. The path in the file is correct and the class also exists at the right location in the jar.

The ending .class is omitted in the MANIFEST.MF. I hope this is correct. Do you have any other hints?

+1  A: 

Make sure that you also have all required libraries in your class path, when you run your jar.

Aleksejs
I'm currently not sure, whether the required libraries can be accessed. That's been actually what I've wanted to test. :DBut shouldn't I get another error message then? Something like "Couldn't load required class ..." or so?
Bernhard V
Maven is not very friendly with error messages. I suggest not to relay too much in them. Have you tried using javac?
Random
Ok, Aleksejs was right. I had to fix the classpath at first. Now that I've done that, I'm no longer getting that error. Yeah, I get another one, but not that one anymore ... :D
Bernhard V