sam
sam

Reputation: 471

Eclipse Java Missing required source folder: 'src'

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

Description Resource Path Location Type
Project 'Interpreter1' is missing required source folder: 'src' Interpreter1 Build path Build Path Problem

How can i get rid of this error?

Upvotes: 46

Views: 138277

Answers (15)

Sabir Khan
Sabir Khan

Reputation: 10142

There was nothing wrong in my project set up , it just started to happen one fine day. To resolve, I had to do just click Apply and Close on Project Build Path Set Up , without actually changing anything.

Upvotes: 0

user123456789
user123456789

Reputation: 83

In my case eclipse reported this in the Problems view on the parent project which does not have any code. I just delete the error whenever it is reported on this parent project where src folder is really not needed.

Upvotes: 0

user12663429
user12663429

Reputation: 1

Eclipse wouldn't let me point to an existing (or add a new) source directory. Eclipse's configuration files can be wonky. In my case I should have started simple. Right click the project and click Refresh.

Upvotes: 0

Rakesh Jain
Rakesh Jain

Reputation: 21

Right-Click Project --> Build Path --> Configure Build Path-->source-->(Select missing folder or path)-->Add Folder-->Apply-->Ok

Upvotes: 2

Ajmal V Aliyar
Ajmal V Aliyar

Reputation: 1669

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.

Upvotes: 0

Radioactive
Radioactive

Reputation: 769

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.

Upvotes: 0

NightWind
NightWind

Reputation: 21

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!

Upvotes: 1

user6727670
user6727670

Reputation:

I was confused by this for hours.

Right click on project -> Build Path -> Configure Build Path -> Add Folder

Upvotes: 1

user358656
user358656

Reputation: 101

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!

Upvotes: 5

bkaid
bkaid

Reputation: 52073

Right Click Project -> New -> Folder -> Folder Name: src -> Finish

Upvotes: 7

Fvergniaud
Fvergniaud

Reputation: 781

Right-Click Project --> Build Path --> Configure Build Path; unselect the SRC, save, select again.

This solved my problem.

Upvotes: 78

Don
Don

Reputation: 401

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.

Upvotes: 0

Tom Anderson
Tom Anderson

Reputation: 47183

Create the src folder in the project.

Upvotes: 1

Bozho
Bozho

Reputation: 597106

Go to the Build Path dialog (right-click project > Build Path > Configure Build Path) and make sure you have the correct source folder listed, and make sure it exists.

The source folder is the one that holds your sources, usuglaly in the form: project/src/com/yourpackage/...

Upvotes: 9

rich
rich

Reputation: 19414

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

Upvotes: 4

Related Questions