Unable to create jar executable via Eclipse

I created a Java project with Eclipse. The project has a method public static void main(String[] args) . When I try to export it to a runnable jar, there is no project that I created in the launch configuration, so I cannot create a jar for the project. Any ideas why?

+4
source share
3 answers

Try creating a new launch configuration from scratch:

  • RunRun Configurations...
  • Right-click “Java Application” in the list on the left and select New
  • Enter a descriptive name on the right.
  • On the Home tab, find the project and search and select the appropriate main class.
  • Close the dialog box.

Now try exporting your executable JAR again using this startup configuration.

+15
source

Either run the project once to automatically create a launch configuration, or go to the project settings and create it manually.

+4
source

Another answer, hoping this helps someone:
I had a situation where the configuration was displayed in the Run -> Run Configurations list , but did not appear in the list of the Ruannable JAR export wizard.
It was cured only after I closed and restarted Eclipse.

0
source

Source: https://habr.com/ru/post/1496912/


All Articles