Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't create a runnable jar file via Eclipse

Tags:

java

eclipse

jar

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?

like image 836
Yonatan Nir Avatar asked Dec 01 '22 03:12

Yonatan Nir


1 Answers

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.

like image 152
Jason C Avatar answered Dec 04 '22 12:12

Jason C