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?
Asked
Active
Viewed 2.7k times
4

CodeMonkey
- 11,196
- 30
- 112
- 203
-
1what is the error message when you attempt to run `java -jar yourExecutable.jar` – jmj Aug 13 '13 at 20:35
-
I would install the M2E plugin for Eclipse, convert the project to Maven, and configure Maven to build the .jar for you instead. – djangofan Aug 13 '13 at 20:37
3 Answers
16
Try creating a new launch configuration from scratch:
Run
->Run Configurations...
- Right click "Java Application" in the list on the left and select
New
- On the right enter a descriptive name.
- In the Main tab browse for your project and search for and select the appropriate main class.
- Close the dialog.
Now try exporting your runnable JAR again using that run configuration.
4
Either run the project once to automatically create a run configuration or go into the project options and create one manually.

Xabster
- 3,710
- 15
- 21
0
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.

c0der
- 18,467
- 6
- 33
- 65