eclipse 我的项目的项目描述文件 (.project) 丢失
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1531532/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
The project description file (.project) for my project is missing
提问by Martin
I am using Eclipse PDT 3.5 on Vista (32 bit). It works, though eclipse needs admin rights to execute. This annoys me, but I accept it.
我在 Vista(32 位)上使用 Eclipse PDT 3.5。它有效,尽管 eclipse 需要管理员权限才能执行。这让我很恼火,但我接受。
But: every now and then (I am not sure, it may even be everytime I want to open a project), I get the error message "The project description file (.project) for my projectis missing.".
但是:时不时地(我不确定,甚至可能每次我想打开一个项目时),我都会收到错误消息“我的项目的项目描述文件 (.project)丢失。”。
It is NOT missing, it is in the main folder of the project. It has no special flags set (it is not hidden, nor system file, nor write-protected).
它没有丢失,它位于项目的主文件夹中。它没有设置特殊标志(它不是隐藏的,也不是系统文件,也不是写保护的)。
This is for ALL projects I have in my list. The only solution I have found so far is to delete the project from eclipse an re-add it. This is somewhat annoying.
这适用于我列表中的所有项目。到目前为止,我找到的唯一解决方案是从 eclipse 中删除该项目并重新添加它。这有点烦人。
What can I do?
我能做什么?
EDIT: The workspaces are on a server volume. Can this be the problem? I used Eclipse 3.3 before, and there it was no problem with the server paths. And the server volume is mapped to a drive letter.
编辑:工作区位于服务器卷上。这可能是问题吗?我之前用过Eclipse 3.3,服务器路径没有问题。并且服务器卷被映射到驱动器号。
回答by Jordi Xucla
I've found this solutionby googling. I have just had this problem and it solved it.
我通过谷歌搜索找到了这个解决方案。我刚刚遇到了这个问题,它解决了它。
My mistake was to put a project in other location out of the workspace, and share this workspace between several computers, where the paths difer. I learned that, when a project is out of workspace, its location is saved in workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/PROJECTNAME/.location
我的错误是将项目放在工作区之外的其他位置,并在路径不同的多台计算机之间共享此工作区。我了解到,当项目不在工作区时,其位置保存在 workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/PROJECTNAME/.location
Deleting .location and reimporting the project into workspace solved the issue. Hope this helps.
删除 .location 并将项目重新导入工作区解决了这个问题。希望这可以帮助。
回答by alexandroid
I had the same problem and in my case .project
file was also present in the project directory and had correct permissions.
我遇到了同样的问题,在我的案例中,.project
文件也存在于项目目录中并且具有正确的权限。
This problem happened to me after I closed and reopened multiple projects quickly one after another and Eclipse tried to rebuild them at the same time.
在我一个接一个地关闭和重新打开多个项目并且 Eclipse 尝试同时重建它们之后,这个问题发生在我身上。
In my case Eclipse lost .location
file in the workspace directory for 2 out of 5 projects: <workspace>/.metadata/.plugins/org.eclipse.core.resources/.projects/<project name>/.location
在我的情况下,Eclipse 丢失.location
了 5 个项目中 2 个的工作区目录中的文件:<workspace>/.metadata/.plugins/org.eclipse.core.resources/.projects/<project name>/.location
I've followed instructions on How to get project list if delete .metadata accidentallyand imported the project in the workspace manually via File :: Import :: Other :: General :: Existing Projects
. After that .location
file was created again and Eclipse stopped complaining.
我已经按照如何在意外删除 .metadata并通过.metadata手动将项目导入工作区时获取项目列表的说明进行操作File :: Import :: Other :: General :: Existing Projects
。.location
再次创建该文件后,Eclipse 停止抱怨。
回答by Alice
I had the same problem, and I haven't gotten that error since I close the project before I close myEclipse and don't tidy up the default location.
我遇到了同样的问题,自从我在关闭 myEclipse 之前关闭项目并且没有整理默认位置以来,我没有遇到那个错误。
My project source and compiled files are outside the default workspace but there are stubb folders created by default by myEclipse in the default workspace. When I setup the project, there are two .project files - one in the default workspace that points to the working dir, and one .project in my chosen directory.
我的项目源和编译文件在默认工作区之外,但默认工作区中有 myEclipse 默认创建的 stubb 文件夹。当我设置项目时,有两个 .project 文件 - 一个在指向工作目录的默认工作区中,另一个在我选择的目录中。
回答by solisarg
If you move the files for whatever reason manually, then Elipse lost the reference and output a missing project file error, but the reason is thaty you move manually the files and Eclipse lost the reference
如果您出于任何原因手动移动文件,则 Elipse 会丢失引用并输出丢失项目文件错误,但原因是您手动移动文件而 Eclipse 丢失了引用
回答by woland
I am using Eclipse 3.5.1 on Ubuntu. After rebooting my machine my projects in PHP Explorer view were giving the warning that the .project file was missing. The problem was that the external directory where my projects are hosted was not mounted on reboot. So I did a mount -afrom the command line and the Eclipse recognized the files.
我在 Ubuntu 上使用 Eclipse 3.5.1。重新启动我的机器后,我在 PHP Explorer 视图中的项目给出了 .project 文件丢失的警告。问题是我的项目所在的外部目录没有在重启时挂载。所以我从命令行执行了mount -a并且 Eclipse 识别了这些文件。
回答by Saam Barrager
If you only want to checkout and you delete the folder from the workspace you also need to delete the reference to it in the Java view. Then it should checkout as if it were checking out for the first time.
如果您只想签出并从工作区中删除文件夹,您还需要在 Java 视图中删除对它的引用。然后它应该像第一次结账一样结账。
回答by Lynxster
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Lynxster</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>
in the name tag give the name of the project folder and save this file with .project extension & paste it in the project folder.
在名称标签中给出项目文件夹的名称,并使用 .project 扩展名保存此文件并将其粘贴到项目文件夹中。
this worked for me.
这对我有用。
回答by Badr Bellaj
In my case i have changed the root folder in which the Eclipse project were stored. I have discovered tha when i have runned :
就我而言,我更改了存储 Eclipse 项目的根文件夹。我在跑步时发现了:
cat .plugins/org.eclip.resources/.projects/<projectname>/.location
回答by Wasted-Art
Martin Encountered the same issue with a Minecraft Mod project when I changed the Main folder location. Normally I would open the project like this
当我更改主文件夹位置时,Martin 在 Minecraft Mod 项目中遇到了同样的问题。通常我会像这样打开项目
This is how my path looked when I started the project
I got the same "The project description file (.project) for my project is missing." Error.
我得到了同样的“我的项目的项目描述文件 (.project) 丢失了”。错误。
I later found the .project file in the main folder like this.
后来我在这样的主文件夹中找到了 .project 文件。
This is the location where I found the .project file
I found that going eclipse to "File->Open Project from File System or Archive" and navigate to your main project folder with the .project file solved the problem.
我发现将 eclipse 转到“文件->从文件系统或存档打开项目”并导航到带有 .project 文件的主项目文件夹解决了问题。
My project is already included
This is my first post in here hoping it can help you out, Martin.
这是我在这里的第一篇文章,希望它能帮到你,马丁。
回答by Dave C
If you keep a backup of your worskpace folder, then all you need to do is restore the following folder from the backup:
如果您保留了工作空间文件夹的备份,那么您需要做的就是从备份中恢复以下文件夹:
workspace/.metadata/.plugins/org.eclipse.core.resources