katie1245
katie1245

Reputation: 1137

Why does my executable jar not find the main class?

Trying to export my java app from Eclipse into a runnable jar file. (It's a console app)

This is what the project directory looks like in Eclipse:

enter image description here


This is what the run configuration of the project looks like:

enter image description here


This is what the jar creation options look like:

enter image description here


And finally, this is the error I get:

enter image description here

I've literally tried everything and I'm so lost as to why it's not running. The main class is selected properly, the run configuration seems right, I tried both runnable and regular, BOTH don't work.

I tried cleaning, rebuilding, and even re-making the project and that didn't work.

I've researched this problem and everyone just suggests stuff like configurating the eclipse java path or making sure my app "isn't in a package" which doesn't make sense to me (aren't all java classes in a package)

Any help would be much appreciated!

Upvotes: 0

Views: 464

Answers (1)

Henry
Henry

Reputation: 43798

The way to run an executable jar from the command line is:

java -jar "AlphaScript_Interactive V1.0.0.jar"

Upvotes: 1

Related Questions