CodeMonkey
CodeMonkey

Reputation: 12444

Can't create a runnable jar file via Eclipse

I made a Java project with Eclipse. The project has a public static void main(String[] args) method in it. When I try to export it to a runnable jar, the launch configuration does not include the project I created so I can't create the jar for the project. Any ideas why?

Upvotes: 4

Views: 27667

Answers (3)

Jason C
Jason C

Reputation: 40396

Try creating a new launch configuration from scratch:

  1. Run -> Run Configurations...
  2. Right click "Java Application" in the list on the left and select New
  3. On the right enter a descriptive name.
  4. In the Main tab browse for your project and search for and select the appropriate main class.
  5. Close the dialog.

Now try exporting your runnable JAR again using that run configuration.

Upvotes: 16

c0der
c0der

Reputation: 18812

One more answer, in hope it will help some one:
I had a situation where the configuration did appear in the Run -> Run Configurations list,
but did not appear on the list of the Ruannable JAR export wizard.
It was cured only after I closed and re-launched Eclipse.

Upvotes: 0

Xabster
Xabster

Reputation: 3720

Either run the project once to automatically create a run configuration or go into the project options and create one manually.

Upvotes: 4

Related Questions