ENUM类型不是一般性错误克隆andengine [英] Type enum is not generic error cloning andengine

查看:275
本文介绍了ENUM类型不是一般性错误克隆andengine的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在AndEngine项目克隆一个仓库后,收到此错误。


  

该类型枚举不是通用的;它不能带参数&LT进行参数设置; BoundsSplit>


这里就是错误仍然存​​在的类。

 包org.andengine.util.spatial.adt.bounds; //错误点,该行的开头。
进口org.andengine.util.exception.AndEngineException;/ **
 *(三)2011 Zynga的
 *
 * @author尼古拉斯·格拉姆利克< ngramlich@zynga.com>
 * @since 21时13分32秒 - 11.10.2011
 * /
 公共枚举BoundsSplit {
// ================================================ ===========
//元素
// ================================================ ===========TOP_LEFT,TOP_RIGHT,BOTTOM_LEFT,BOTTOM_RIGHT;// ================================================ ===========
//常量
// ================================================ ===========// ================================================ ===========
//领域
// ================================================ ===========// ================================================ ===========
//构造函数
// ================================================ ===========// ================================================ ===========
//吸气和放大器;二传手
// ================================================ ===========// ================================================ ===========
//方法/从父类/接口
// ================================================ ===========// ================================================ ===========
// 方法
// ================================================ ===========// ================================================ ===========
//内部和匿名类
// ================================================ ===========公共静态类BoundsSplitException扩展AndEngineException {
    // ================================================ ===========
    //常量
    // ================================================ ===========    私有静态最后的serialVersionUID长= 7970869239897412727L;    // ================================================ ===========
    //领域
    // ================================================ ===========    // ================================================ ===========
    //构造函数
    // ================================================ ===========    // ================================================ ===========
    //吸气和放大器;二传手
    // ================================================ ===========    // ================================================ ===========
    //方法/从父类/接口
    // ================================================ ===========    // ================================================ ===========
    // 方法
    // ================================================ ===========    // ================================================ ===========
    //内部和匿名类
    // ================================================ ===========
}

}

编辑:

下面是更多的错误说什么

 在该行多个标记
- 类型java.lang.Enum中不能得到解决。它是间接引用
 所需的.class文件
- 该类型枚举不是通用的;它不能与自变量进行参数设置
 < BoundsSplit>
- 该java.lang.Object类型不能得到解决。它是间接引用
 所需的.class文件
- 类型java.lang.Enum中不能得到解决。它是间接引用
 所需的.class文件


解决方案

好了,似乎这个错误有多方面的原因。从网上搜索的主要原因之一(<一个href=\"http://www.google.co.il/search?rlz=1C1CHHJ_iwIL436IL436&sourceid=chrome&ie=UTF-8&q=The%20type%20java.lang.Enum%20cannot%20be%20resolved.%20It%20is%20indirectly%20referenced%20fromrequired%20.class%20files\"相对=nofollow>这里)是在项目目录中的的.classpath 文件是错误的 - 这是一个我了。这可能AndEngine的项目谁拥有了错误的文件,因为你说过,当你更新它遇到了这个问题。

所以,你可以:


  1. 解决它。 <一href=\"http://www.adriancourreges.com/articles/the-type-java-lang-object-cannot-be-resolved-with-eclipse/\"相对=nofollow>这个页面有问题的一个很好的解释,检查出来。你可以得到更多的信息<一个href=\"http://stackoverflow.com/questions/4734680/the-type-java-lang-string-cannot-be-resolved-it-is-indirectly-referenced-from-r\">here.

  2. 代替进口AndEngine源到工作区在Eclipse(我猜你这样做,因为这可能是问题的根源),你可以直接链接的源文件夹,然后Eclipse将不会错误检查AndEngine项目文件(这可能是错误的)。

另外一个原因可能是由于错误配置的JRE系统库。还有就是如何在这里一个很好的教程一>

顺便说一句,这个问题偏食有关,所以我会重新标记与问题日食标签,所以如果我的回答不会帮助 - 至少你将得到更好的:)

I keep getting this error after cloning a repository from the AndEngine project..

The type Enum is not generic; it cannot be parameterized with arguments <BoundsSplit>

Here is the class where the error persists.

package org.andengine.util.spatial.adt.bounds; //The error points at the beginning of this line.
import org.andengine.util.exception.AndEngineException;

/**
 * (c) Zynga 2011
 *
 * @author Nicolas Gramlich <ngramlich@zynga.com>
 * @since 21:13:32 - 11.10.2011
 */
 public enum BoundsSplit {
// ===========================================================
// Elements
// ===========================================================

TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_RIGHT;

// ===========================================================
// Constants
// ===========================================================

// ===========================================================
// Fields
// ===========================================================

// ===========================================================
// Constructors
// ===========================================================

// ===========================================================
// Getter & Setter
// ===========================================================

// ===========================================================
// Methods for/from SuperClass/Interfaces
// ===========================================================

// ===========================================================
// Methods
// ===========================================================

// ===========================================================
// Inner and Anonymous Classes
// ===========================================================

public static class BoundsSplitException extends AndEngineException {
    // ===========================================================
    // Constants
    // ===========================================================

    private static final long serialVersionUID = 7970869239897412727L;

    // ===========================================================
    // Fields
    // ===========================================================

    // ===========================================================
    // Constructors
    // ===========================================================

    // ===========================================================
    // Getter & Setter
    // ===========================================================

    // ===========================================================
    // Methods for/from SuperClass/Interfaces
    // ===========================================================

    // ===========================================================
    // Methods
    // ===========================================================

    // ===========================================================
    // Inner and Anonymous Classes
    // ===========================================================
}

}

EDIT:

Here is more on what the error says

Multiple markers at this line
- The type java.lang.Enum cannot be resolved. It is indirectly referenced from 
 required .class files
- The type Enum is not generic; it cannot be parameterized with arguments 
 <BoundsSplit>
- The type java.lang.Object cannot be resolved. It is indirectly referenced from 
 required .class files
- The type java.lang.Enum cannot be resolved. It is indirectly referenced from 
 required .class files

解决方案

Well, it seems that this error has many causes. The main one from searching the web (Here) is that the .classpath file in the project directory is wrong - that's the one I had, too. It's probably AndEngine's project who has the wrong file, because you said this problem was encountered when you updated it.

So, you can either:

  1. Solve it. This page has a nice explanation of the problem, check it out. You can get more information here.
  2. Instead of importing AndEngine source into your workspace in eclipse (Which I guess you did, because that's probably the source of the problem), you can just link the source folder, then eclipse won't bug checking the AndEngine project files (Which might be wrong).

Another reason might be because of mis-configured JRE system library. There is a nice tutorial of how to fix that here.

By the way, this problem is related to eclipse, so I'll retag your question with eclipse tag, so if my answer won't help - at least you will get better ones :)

这篇关于ENUM类型不是一般性错误克隆andengine的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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