Eclipse can't find / load main class

前端 未结 20 2154
猫巷女王i
猫巷女王i 2020-12-05 04:40

My Eclipse (Indigo) was running just fine. I created a simple class Hello. It is placed in package cont in the folder ch13. However

20条回答
  •  醉梦人生
    2020-12-05 05:18

    • Removing the Run Configuration

      Sometimes I have a similar problems in some pre-release versions of eclipse. For fix the error, I delete the Run Configuration. You can find that in menu Run, Run Configurations...

      Then I launch the app with Alt+Shift+X, then J. If this don't work, Ctrl+F11.

    • Deleting the .metadata directory

      In another way, the configuration settings for your current workspace may are corrupted. Those settings are in the .metadata directory in your current workspace 1. In that case, there is no other choice than delete the directory:

      1. Close eclipse.
      2. Delete the .metadata directory.
      3. Start eclipse.
      4. Import the projects.
      5. Run the project again.

    Notes

    1. You will see that directory with File > Switch Workspace > Other...

提交回复
热议问题