类型枚举不是通用错误克隆和引擎

发布于 2024-12-23 22:16:22 字数 3586 浏览 0 评论 0原文

从 AndEngine 项目克隆存储库后,我不断收到此错误。

Enum 类型不是通用的;它不能用参数进行参数化

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

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 <[email protected]>
 * @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
    // ===========================================================
}

编辑

这里有更多关于错误的内容

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

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 <[email protected]>
 * @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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

奶气 2024-12-30 22:16:22

嗯,看来这个错误有很多原因。主要来自搜索网络(这里)是项目目录中的.classpath 文件是错误的 - 这也是我的文件。很可能是AndEngine的项目文件有错误,因为你说更新的时候遇到了这个问题。

因此,您可以:

  1. 解决它。 这个页面对问题有很好的解释,请查看。您可以获取更多信息 这里
  2. 您不必将 AndEngine 源导入到 eclipse 中的工作区(我猜您这样做了,因为这可能是问题的根源),您只需链接源文件夹,然后 eclipse 就不会错误检查 AndEngine 项目文件(这可能是错误的)。

另一个原因可能是 JRE 系统库配置错误。有一个关于如何解决这个问题的很好的教程这里< /a>.

顺便说一句,这个问题与 eclipse 有关,所以我会用 eclipse 标签重新标记你的问题,所以如果我的答案没有帮助 - 至少你会得到更好的答案:)

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 :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文