Eclipse Java Missing required source folder: 'src'

前端 未结 14 871
伪装坚强ぢ
伪装坚强ぢ 2021-01-01 08:48

I imported a jar file into workspace and this is the error I get:

Description Resource Path Location Type
Project \'Interpreter1\'

相关标签:
14条回答
  • 2021-01-01 09:10

    Edit your .classpath file. (Or via the project build path).

    0 讨论(0)
  • 2021-01-01 09:11

    Here's what worked for me: right click the project-> source -> format After that just drag and drop the source folder into eclipse under the project and select link.

    good luck!

    0 讨论(0)
  • 2021-01-01 09:11

    One of the build path issue is it cannot find the correct /src/conf source folder. Right click on each project, Build Path > Configure Build Path. Under the Source tab, remove the folder with a red cross icon on the bottom right. It will work for the situation that there is a small red exclamation mark “!“ bedore your project name!

    0 讨论(0)
  • 2021-01-01 09:17

    In eclipse, you must be careful to create a "source folder" (File->New->Source Folder). This way, it's automatically on your classpath, and, more importantly, Eclipse knows that these are compilable files. It's picky that way.

    0 讨论(0)
  • 2021-01-01 09:17

    If you are facing an error with the folder, such as src/test/java or src/test/resources, just do a right click on the folder and then create a a new folder with the name being src/test/java. This should solve your problem.

    0 讨论(0)
  • 2021-01-01 09:18

    I think it's because of the .classpath getting saved with the deleted source folder configuration.

    1. Create the missing folder [ 'src' in your case] manually inside the root of the project. When I say manually, I meant outside Eclipse, using the file explorer.

    2. Then, come back to eclipse and refresh the project. Now, the error saying it's already there will be gone.

    3. Now, Right click on the project > Build Path > Configure Build path. It should take us to the Java build path side menu.

    4. Make sure we are on the 'Source' tab. Delete the source folder causing the problem. Now, maybe the folder might show up in the project structure and you may delete that too.

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