Eclipse Java Missing所需的源文件夹:'src'

时间:2023-01-15 21:31:56

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

我将jar文件导入工作区,这是我得到的错误:

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

说明资源路径位置类型项目'Interpreter1'缺少必需的源文件夹:'src'Slapterter1构建路径构建路径问题

How can i get rid of this error?

我怎样才能摆脱这个错误?

10 个解决方案

#1


56  

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

右键单击项目 - >构建路径 - >配置构建路径;取消选择SRC,保存,再次选择。

This solved my problem.

这解决了我的问题。

#2


8  

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/...

源文件夹是保存您的源的文件夹,可以使用以下格式:project / src / com / yourpackage / ...

#3


5  

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

右键单击项目 - >新建 - >文件夹 - >文件夹名称:src - >完成

#4


3  

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

编辑.classpath文件。 (或通过项目构建路径)。

#5


3  

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.

这对我有用:右键单击项目 - >源 - >格式然后将源文件夹拖放到项目下的eclipse中并选择链接。

good luck!

#6


1  

Create the src folder in the project.

在项目中创建src文件夹。

#7


1  

I was confused by this for hours.

几个小时我都很困惑。

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

右键单击项目 - >构建路径 - >配置构建路径 - >添加文件夹

#8


1  

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!

其中一个构建路径问题是找不到正确的/ src / conf源文件夹。右键单击每个项目,构建路径>配置构建路径。在“源”选项卡下,删除右下角带有红叉图标的文件夹。这将适用于有一个小的红色感叹号“!”的情况,你的项目名称!

#9


0  

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.

在eclipse中,您必须小心创建“源文件夹”(文件 - >新建 - >源文件夹)。这样,它会自动在您的类路径上,更重要的是,Eclipse知道这些是可编译的文件。这样挑剔。

#10


0  

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.

如果您遇到文件夹错误,例如src / test / java或src / test / resources,只需右键单击该文件夹,然后创建一个名为src / test / java的新文件夹。这应该可以解决您的问题。

#1


56  

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

右键单击项目 - >构建路径 - >配置构建路径;取消选择SRC,保存,再次选择。

This solved my problem.

这解决了我的问题。

#2


8  

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/...

源文件夹是保存您的源的文件夹,可以使用以下格式:project / src / com / yourpackage / ...

#3


5  

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

右键单击项目 - >新建 - >文件夹 - >文件夹名称:src - >完成

#4


3  

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

编辑.classpath文件。 (或通过项目构建路径)。

#5


3  

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.

这对我有用:右键单击项目 - >源 - >格式然后将源文件夹拖放到项目下的eclipse中并选择链接。

good luck!

#6


1  

Create the src folder in the project.

在项目中创建src文件夹。

#7


1  

I was confused by this for hours.

几个小时我都很困惑。

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

右键单击项目 - >构建路径 - >配置构建路径 - >添加文件夹

#8


1  

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!

其中一个构建路径问题是找不到正确的/ src / conf源文件夹。右键单击每个项目,构建路径>配置构建路径。在“源”选项卡下,删除右下角带有红叉图标的文件夹。这将适用于有一个小的红色感叹号“!”的情况,你的项目名称!

#9


0  

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.

在eclipse中,您必须小心创建“源文件夹”(文件 - >新建 - >源文件夹)。这样,它会自动在您的类路径上,更重要的是,Eclipse知道这些是可编译的文件。这样挑剔。

#10


0  

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.

如果您遇到文件夹错误,例如src / test / java或src / test / resources,只需右键单击该文件夹,然后创建一个名为src / test / java的新文件夹。这应该可以解决您的问题。