.project和.classpath文件在Eclipse中丢失 [英] .project and .classpath files are missing in eclipse

查看:267
本文介绍了.project和.classpath文件在Eclipse中丢失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个项目,其中没有作为单独的Java项目构建的应用程序。

这些已由某人发送,并且以某种方式由 .project .classpath 文件尚未复制。

I have a project where there are a no of applications built as separate Java projects.
These have been sent over by someone and somehow the .project and the .classpath files have not been copied.

因此,当我尝试将其导入eclipse时,它给了我一个错误: 未找到项目。< br>
有什么方法可以生成丢失的文件吗?

So when I try to import it into eclipse it gives me an error:"No project found".
Is there any way to generate the missing files?

推荐答案

首先,您可以这样做的原因不是将项目导入Eclipse工作站是因为您没有 .project .classpath 文件。

First of all, the reason why you can not Import your project into Eclipse workstation is that you do not have .project and .classpath file.

现在您知道为什么会这样了,所以我们要做的就是创建 .project .classpath 文件放在项目文件中。操作方法如下:

Now that you know why this happens, so all we need to do is to create .project and .classpath file inside the project file. Here is how you do it:

首先,创建 .classpath 文件:


  1. 创建一个新的txt文件并将其命名为 .classpath

复制并粘贴以下代码并保存:

Copy and paste following code and save it:

 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
 <classpathentry kind="src" path="src"/>
 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
 <classpathentry kind="output" path="bin"/>
 </classpath>



然后,创建 .project 文件:


  1. 创建一个新的txt文件并命名为。 project

复制粘贴以下代码:

 <?xml version="1.0" encoding="UTF-8"?>
 <projectDescription>
 <name>HereIsTheProjectName</name>
 <comment></comment>
 <projects>
 </projects>
 <buildSpec>
 <buildCommand>
 <name>org.eclipse.jdt.core.javabuilder</name>
 <arguments>
 </arguments>
 </buildCommand>
 </buildSpec>
 <natures>
 <nature>org.eclipse.jdt.core.javanature</nature>
 </natures>
 </projectDescription>



  • 您必须将名称字段更改为项目名称。您可以在第3行中通过将 HereIsTheProjectName 更改为您自己的项目名称,然后保存它来完成此操作。

  • You have to change the name field to your project name. You can do this in line 3 by changing HereIsTheProjectName to your own project name and then saving it.

    这篇关于.project和.classpath文件在Eclipse中丢失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆