David Tunnell David Tunnell - 1 year ago 138
Java Question

Failing to run jar file from command line: “no main manifest attribute”

I am trying to run a jar file from the console:

java -jar ScrumTimeCaptureMaintenence.jar

And am getting the error:

Can't execute jar- file: “no main manifest attribute”

As you can see I do in fact have a main file and it runs fine from eclipse:

main method is in class

What do I need to do to successfully run this file from the command line?

Answer Source

Try to run

java -cp ScrumTimeCaptureMaintenence.jar Main
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download