zoukankan      html  css  js  c++  java
  • gen already exists but is not a source folder. Convert to a source folder or rename it.

    异常提示:

    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文件,如下:
    [xml] view plaincopy在CODE上查看代码片派生到我的代码片
     
    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的源码位置即可。
     
    摘自:http://blog.csdn.net/zhufuing/article/details/21086893
  • 相关阅读:
    centos7 安装kafka Manager
    MySql Table错误:is marked as crashed and last (automatic?) 和 Error: Table "mysql"."innodb_table_stats" not found
    安装prometheus+grafana监控mysql redis kubernetes等
    centos7 安装kubernetes1.4
    linux ip 转发设置 ip_forward
    开启Tomcat远程调试(转)
    SSH自动断开连接的原因、配置(转)
    解决mysql启动时报The server quit without updating PID file 的错误(转)
    supervisor的集中化管理搭建
    supervisor安装配置
  • 原文地址:https://www.cnblogs.com/antyi/p/4068945.html
Copyright © 2011-2022 走看看