将项目文件放入工作区/项目后,Eclipse 项目未显示

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8684279/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 20:48:08  来源:igfitidea点击:

Eclipse projects not showing up after placing project files in workspace/projects

eclipseprojectexplorerprojectsinvisible

提问by D3_JMultiply

I've searched for 2 days and can't find anything. I find things that are close, but not what I need.

我已经搜索了 2 天,找不到任何东西。我找到了接近的东西,但不是我需要的东西。

I got a new computer recently and copied all of my projects over to my new computer.

我最近买了一台新电脑,并将我所有的项目复制到我的新电脑上。

I opened Eclipse and generated a workspace, which I then closed out of Eclipse and copied my projects into the workspace/projects folder.

我打开了 Eclipse 并生成了一个工作区,然后我关闭了 Eclipse 并将我的项目复制到了工作区/项目文件夹中。

I reopen Eclipse and my projects do not show up at all in the package explorer.

我重新打开 Eclipse,我的项目根本没有出现在包浏览器中。

I know that I have the correct folders in the correct directory.

我知道我在正确的目录中有正确的文件夹。

The closest thread I found to this is: Eclipse - Import an existing project?

我找到的最接近的线程是:Eclipse - 导入现有项目?

but even that didn't help, my projects already meet that...

但即使那样也无济于事,我的项目已经满足了......

I have tried refreshing, reopening, fooling with working sets, etc...

我尝试过刷新,重新打开,愚弄工作集等......

回答by JB Nizet

Just because you have a project inside the workspace directory doesn't mean Eclipse opens it or even sees it automatically. You must use File - Import - General - Import existing project into workspaceto have your project in Eclipse.

仅仅因为您在工作区目录中有一个项目并不意味着 Eclipse 会打开它甚至自动看到它。您必须使用File - Import - General - Import existing project into workspace才能在 Eclipse 中拥有您的项目。

回答by David K Hill

For Juno: (With Source in E:\workspace and destination in C:\workspace)

对于 Juno:(源在 E:\workspace 和目标在 C:\workspace)

  1. Copy project directory in its entirety to the workspace directory. (e.g. Copy E:\workspace\HelloWorld C:\workspace\helloWorld)

  2. Start Eclipse.

  3. Perform: File --> Import

  4. Select: General -- > "Existing Project into Workspace"

  5. "Next >"

  6. Check "Select root Directory"

  7. Select with "Browse Button"

  8. Select "C:\workspace"

  9. A list of existing projects will appear. Just check the ones that are in Bold (To Be Imported) then press the "Finish" button.

  1. 将整个项目目录复制到工作区目录。(例如复制 E:\workspace\HelloWorld C:\workspace\helloWorld)

  2. 启动日食。

  3. 执行:文件 --> 导入

  4. 选择:General -->“Existing Project into Workspace”

  5. “下一个>”

  6. 勾选“选择根目录”

  7. 使用“浏览按钮”选择

  8. 选择“C:\工作区”

  9. 将出现现有项目的列表。只需检查粗体(待导入)中的那些,然后按“完成”按钮。

Review the Package Explorer and your copied projects should now be there.

查看包资源管理器,您复制的项目现在应该在那里。

回答by Aman Goel

This problems comes while .metadata of current workspace has been corrupted due to shut down Eclipse Unexpectedly. So if you face this problem just do the following steps:

由于意外关闭 Eclipse,当前工作区的 .metadata 已损坏时出现此问题。因此,如果您遇到此问题,请执行以下步骤:

  • Create a new workspace. Import your existing projects to your new workspace.

  • 创建一个新的工作区。将现有项目导入到新工作区。

you made it!

你做到了!

回答by Mr.Java

I had the same problem over and over again the solution that a have found works for now

我一遍又一遍地遇到同样的问题,找到的解决方案现在有效

  1. Close Eclipse.
  2. go to workspace.metadata.plugins
  3. remove org.eclipse.core.resources
  4. Start Eclipse
  5. Do File->Import
  6. General->Existing Projects into Workspace and import all the project from the workspace
  1. 关闭日食。
  2. 转到workspace.metadata.plugins
  3. 删除 org.eclipse.core.resources
  4. 启动日食
  5. 做文件->导入
  6. General->Existing Projects into Workspace 并从工作区导入所有项目

回答by paulsm4

  1. Netbeans allows you to do a simple filecopy. As you know, Eclipse doesn't work like that. You must explicitly "import" files and projects.

  2. If you doimport, and if there are no problems, then they shouldshow up.

  3. I'd consider:

    a) making a backup of your existing workspace

    b) deleting and reinstalling Eclipse

    c) Trying another "test import"

  1. Netbeans 允许您进行简单的文件复制。如您所知,Eclipse 不是这样工作的。您必须明确“导入”文件和项目。

  2. 如果您进行导入,并且没有问题,那么它们应该会出现。

  3. 我会考虑:

    a) 备份您现有的工作区

    b) 删除并重新安装 Eclipse

    c) 尝试另一个“测试导入”

回答by Francis Upton IV

You put them in the workspace/projectsfolder. You should put them directly in the workspacefolder and then do an Import Existing Projects into workspace.

你把它们放在workspace/projects文件夹里。您应该将它们直接放在workspace文件夹中,然后将现有项目导入工作区。

回答by Rajeev Rastogi

Even I had also observed the similar problem. I had closed my eclipse project because of some reason and on restart some of my file added were not visible in explorer even though corresponding file were existing.

甚至我也观察到了类似的问题。由于某种原因,我已经关闭了我的 eclipse 项目,并且在重新启动时,即使存在相应的文件,我添加的一些文件在资源管理器中也不可见。

Following solution worked for me: Select whole workspace (Ctrl+A) ==> Righ click and press Refresh.

以下解决方案对我有用:选择整个工作区 (Ctrl+A) ==> 右键单击​​并按刷新。

回答by ahmedibrahim085

in Eclips the Package Explorer Right click on any viewable project and select Show in -> Project Explorer

在 Eclips 包资源管理器中右键单击任何可查看的项目并选择显示在 -> 项目资源管理器

Package Explorer -> Right click -> Show in ->Project Explorer

包资源管理器 -> 右键单击​​ -> 显示在 -> 项目资源管理器

you should be able to see all the imported projects in your Eclipse workspace

您应该能够在 Eclipse 工作区中看到所有导入的项目

回答by GraSim

Or you could try:

或者你可以试试:

  1. Go to File-> Switch Workspace
  2. Select your workspace (if shown)
  1. 转到文件- >切换工作区
  2. 选择您的工作区(如果显示)

回答by M Jenkinson

Here's a specific problem I ran into when downloading a project from the internet.

这是我从 Internet 下载项目时遇到的一个具体问题。

  1. Make sure you unzip correctly if it's zipped, you can sometimes get an extra level.
  2. Make sure you place the project in the project file, not directly in workspace.
  3. See if .project and .classpath have been renamed to _project and _classpath. You can't rename them directly so open a text document called .classpath and paste _classpath 's contents in there, saving as all files, not a .txt. _classpath can be opened with notepad.
  4. Import the project from the file workspace. It will look for a folder called projects, your's should be inside it.

    Hope this helps :)
  1. 如果已压缩,请确保正确解压缩,有时您可以获得额外的级别。
  2. 确保将项目放在项目文件中,而不是直接放在工作区中。
  3. 查看 .project 和 .classpath 是否已重命名为 _project 和 _classpath。您不能直接重命名它们,因此打开一个名为 .classpath 的文本文档并将 _classpath 的内容粘贴到其中,另存为所有文件,而不是 .txt。_classpath 可以用记事本打开。
  4. 从文件工作区导入项目。它将寻找一个名为项目的文件夹,你的应该在里面。

    希望这可以帮助 :)