Eclipse cannot create runnable jar - No resources selected

前端 未结 13 1612
失恋的感觉
失恋的感觉 2020-12-29 19:35

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

相关标签:
13条回答
  • 2020-12-29 20:00

    I was having this same problem, and I was able to resolve it. Maybe you should cross verify the main class, that you selected in this project. It is possible that some other project's main class may have the same name as the main class you selected. Make sure the main class you selected is the one from the project that you selected.

    0 讨论(0)
  • 2020-12-29 20:01

    Check that your project is correct at the time when you select the main class.

    If the class non exist, it's the standard error of Eclipse.

    0 讨论(0)
  • 2020-12-29 20:02

    I found another solution.

    I found that there's a bug in JDK 9.

    I solved it by downgrade to JDK 8(1.8.1)

    0 讨论(0)
  • 2020-12-29 20:02

    I continued to get the "no resources selected" error. I then did the procedure I am quoting and it gave me a MANIFEST file. Then I was able to create an executable JAR.

    Quoting: "I exported the project as an archive file. Then I opened up a new workspace and imported the the archived project. After that I tried to export the project as a runnable jar, after two tries the jar runs as is it should."

    0 讨论(0)
  • 2020-12-29 20:03

    Just copy the project as a new one. Configure the build path by creating new Run/Debug Settings.this would resolve the problem.

    0 讨论(0)
  • 2020-12-29 20:04

    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.

    0 讨论(0)
提交回复
热议问题