Eclipse cannot create runnable jar - No resources selected

TrashCan picture TrashCan · Jul 2, 2012 · Viewed 48.2k times · Source

When I try to export my project as a runnable jar Eclise gives me the following error:

No resources selected.

The project runs fine within Eclipse, I already tried to clean the project before exporting, but that didn´t work.

Any ideas on how to fix this.

Answer

Robert Christian picture Robert Christian · Sep 24, 2012

The problem is most likely with your run configuration.

  • Go to your Class that contains the main(String[] args) method you wish to automatically run when the jar is called from the command line
  • Right-click->Run As...->Application
  • Make sure it runs to your satisfaction
  • Now go through the export process as before, selecting the newly created launch configuration.

The last step is key.