简体   繁体   English

为什么我添加到“工作区”文件夹中的项目不显示? [日食]

[英]Why do projects that I add to my 'workspace' folder don't show up? [ECLIPSE]

I am using Eclipse Indigo, and after having successfully extracted my project folder into my Eclipse workspace, it does not show up in the package explorer. 我正在使用Eclipse Indigo,并且已成功将项目文件夹提取到Eclipse工作区中,但该文件夹未显示在包浏览器中。 I tried refreshing eclipse and restarting it, to no avail. 我尝试刷新日食并重新启动它,但无济于事。 I am 100% certain my eclipse is using the right directory and the project is in it. 我100%确信我的日食正在使用正确的目录,并且项目在其中。

What could be the problem? 可能是什么问题呢? Thank you. 谢谢。

EDIT: "import projects into workspace" worked for me, but why was that necessary? 编辑:“导入项目到工作区”为我工作,但为什么那是必要的?

Files in the directory are not automatically picked up by the package explorer. 软件包资源管理器不会自动提取目录中的文件。 You need to import them. 您需要导入它们。

Try using the File > import, then choose 尝试使用“文件”>“导入”,然后选择

Existing Projects into workspace.

There is a checkbox that says "Copy projects into workspace" which copies it to your workspace if it happens to be in a different folder. 如果有一个复选框“复制项目到工作区”,则将其复制到您的工作区(如果它恰好位于另一个文件夹中)。 If you start with your files in another folder, you'll see how it's copied and set up with configuration files in your workspace directory. 如果从另一个文件夹中的文件开始,您将看到如何复制文件并在工作区目录中使用配置文件进行设置。

To answer the question, "why is it necessary to import?" 要回答这个问题,“为什么需要导入?” you have to realize that the Eclipse workspace is just a logical container for projects , not necessarily the physical container for them. 您必须意识到Eclipse工作区只是项目的逻辑容器 ,而不一定是项目的物理容器。

Also realize that a directory of project-related files does not make an Eclipse Project; 还应意识到与项目相关的文件的目录并不构成Eclipse Project。 Eclipse must be given or generate it's own set of configuration in order to understand a project (minimally, for Java projects, .project and .classpath ). 为了理解项目,必须给Eclipse或生成它自己的一组配置(至少对于Java项目是.project.classpath )。 Without those, Eclipse has no idea what to do with an arbitrary folder that you call a "project." 如果没有这些文件夹,Eclipse将不知道如何处理称为“项目”的任意文件夹。 That's what the Import or Create Project wizards are doing under the covers, generating those config files. 这就是导入创建项目向导在后台进行的操作,生成了这些配置文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM