异常提示:

gen already exists but is not a source folder. Convert to a source folder or rename it.
 

错误原因:

我在导入以前的项目的时候出现了这个异常,原因是.classpath文件(这个文件在eclipse中是看不到的,必须在文件浏览器中才能看到并编辑)出错,导致eclipse不能识别我的src代码文件夹,需要通过设置来指明源码所在的文件夹。
 

解决办法:

右键项目,选择Properties——Java Build Path——Source——Add Folder...
然后在弹出框中选中项目的src和gen目录,OK即可。如下图所示:
 
当然,既然是.classpath文件出错,我们也可以通过手动修改.classpath文件来修复这个错误,下面我们来看下正常的.classpath文件,如下:
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <classpath>
  3. <classpathentry kind="src" path="src"/>
  4. <classpathentry kind="src" path="gen"/>
  5. <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
  6. <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
  7. <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
  8. <classpathentry exported="true" kind="lib" path="libs/android-support-v4.jar"/>
  9. <classpathentry exported="true" kind="lib" path="libs/gson-2.2.4.jar"/>
  10. <classpathentry exported="true" kind="lib" path="libs/umeng_sdk.jar"/>
  11. <classpathentry kind="output" path="bin/classes"/>
  12. </classpath>
kind="src"指明源码位置
kind="con"指明当前系统环境
kind="lib"指明工程依赖的library的具体位置
kind="output"指明项目生成文件的输入位置
 
修复这个异常只需要我们手动指明src的源码位置即可。

gen already exists but is not a source folder. Convert to a source folder or rename it.的更多相关文章

  1. …gen already exists but is not a source folder. Convert to a source folder or rename it [closed]

    Right click on the project and go to "Properties" Select "Java Build Path" on th ...

  2. 导入别人的Android项目,提示 /Libs/gen already exists but is not a source folder. Convert to a source folder or rename it

    解决方法: 遇到这个问题的解决方法: 1. 右键点击工程,选择 "Properties" 2. 选择左边的 "Java Build Path" 3. 打开 &q ...

  3. gen already exists but is not a source folder. Convert to a source folder or rename it 的解决办法

    1. Right click on the project and go to "Properties" //鼠标右键点击项目,然后选中Properties   2. Select ...

  4. Eclipse.Error.gen already exists but is not a source folder.

    在Eclipse ADT来开发Android App时会遇到以下问题:"myproject/gen already exists but is not a source folder. Co ...

  5. gen already exists but is not a source folder

    遇到android项目导入出现后重复空包等错误,往往是导入的java编译级别有关,点击项目properties-> java Compiler ->修改Compiler complianc ...

  6. Convert to a source folder or rename it.

    从GitHub上恢复之前的版本  eclipse 报错: Convert to a source folder or rename it. 网上找了答案 : 找到了这个 1. 删除gen文件. 2.选 ...

  7. 把Flume的Source设置为 Spooling directory source

    把Flume的Source设置为 Spooling directory source,在设定的目录下放置需要读取的文件,一些文件在读取过程中会报错. 文件格式和报错如下: 实验一 读取汉子和“:&qu ...

  8. 在Eclipse工具里创建maven的web工程,在建立src/main/java包出现The folder is already a source folder.解决

    1. 与创建普通java工程一样,点击右键找到New菜单,在弹出的界面输入maven ---->>点击maven Project------>>点击next 2  进入下一个界 ...

  9. The folder is already a source folder

    不知为啥,创建了一个maven项目后,发现只有src/main/resources这个资源文件夹,然后,右键新建 Source Folder 时提示 “The folder is already a ...

随机推荐

  1. 第二十九课:javascript异步处理

    大家知道javascript中有多少方法能够实现异步处理吗?setTimeout(),setInterval()是最常用的两个.XMLHttpRequest对象,进行ajax请求时.postMessa ...

  2. javascript函数自调用

    1. 函数是由事件驱动的或者当它被调用时执行的可重复使用的代码块. 2.  将函数用 “()”括起来, 后面再加一个“()” 3.  javascript函数的内置对象arguments对象,  它包 ...

  3. java连接sql server2000/2005

    接触Java或者JSP,难免会使用到数据库SQL Server 2000/2005(我使用2005标准版[9.0.3054]测试),经过自己的搜索和研究,使用JDBC连接SQL Server成功,特此 ...

  4. iOS边练边学--NSURLConnection发送HTTP请求以及NSString和NSData的相互转换

    HTTP请求的常见方法 GET 所有参数拼接在URL后面,并且参数之间用&隔开 比如http://520it.com?name=123&pwd=345 传递了2个参数给服务器 name ...

  5. Java-HashMap和HashTable的区别

    类继承and实现上看 public class Hashtable extends Dictionary implements Map, Cloneable, java.io.Serializable ...

  6. 人工蜂群算法-python实现

    ABSIndividual.py import numpy as np import ObjFunction class ABSIndividual: ''' individual of artifi ...

  7. poj 3463 最短路与次短路&&统计个数

    题意:求最短路和比最短路长度多1的次短路的个数 本来想图(有)方(模)便(版)用spfa的,结果妹纸要我看看dijkstra怎么解.... 写了三遍orz Ver1.0:堆优化+邻接表,WA //不能 ...

  8. 洛谷P1262 间谍网络

    本来只想刷道小题,没想到还有点麻烦 题目描述 由于外国间谍的大量渗入,国家安全正处于高度的危机之中.如果A间谍手中掌握着关于B间谍的犯罪证据,则称A可以揭发B.有些间谍收受贿赂,只要给他们一定数量的美 ...

  9. 关于“wining attitude”

    同学转的诺基亚招聘启事上看到这样一则要求:“a real team player with wining attitude”.我的反应先是好奇,后是惊讶!好奇是好奇怎么个wining attitude ...

  10. 获取本机IP_考虑多网卡的情况

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.D ...