我在设置Libgdx源代码时遇到了问题,我已经按照这两个设置指南进行了操作: https://github.com/libgdx/libgdx/wiki/Setting-up-your-Development-Environment-%28Eclipse%2C-Intellij-IDEA%2C-NetBeans%29
https://github.com/libgdx/libgdx/wiki/Running-demos-%26-tests
我已经下载了源代码,拥有最新版本的JDK,安装了Android SDK for Android 25,并完成了所有其他步骤(据我所知),但我有成千上万的错误我的libgdx设置,即使我尝试清理和重建。错误都是“无法解析为类型”。有谁知道我可能搞砸了哪一步?
另外,我尝试运行“ant”,他们忘记在正在运行的演示页面中提及,但仍然没有解决问题。
可能是因为我使用的是Java 8 JDK,而libgdx仍然使用Java 7吗?
Description Resource Path Location Type
AnimationCallback cannot be resolved to a type GwtApplication.java /gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt line 214 Java Problem
AnimationScheduler cannot be resolved GamepadSupport.java /gdx-controllers-gwt/src/com/badlogic/gdx/controllers/gwt/support line 143 Java Problem
AnimationScheduler cannot be resolved GamepadSupport.java /gdx-controllers-gwt/src/com/badlogic/gdx/controllers/gwt/support line 156 Java Problem
AnimationScheduler cannot be resolved GwtApplication.java /gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt line 214 Java Problem
AnimationScheduler cannot be resolved GwtApplication.java /gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt line 223 Java Problem
AnimationScheduler cannot be resolved to a type GamepadSupport.java /gdx-controllers-gwt/src/com/badlogic/gdx/controllers/gwt/support line 136 Java Problem
ArrayBuffer cannot be resolved to a type DirectByteBuffer.java /gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/emu/java/nio line 43 Java Problem
ArrayBuffer cannot be resolved to a type DirectByteBuffer.java /gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/emu/java/nio line 47 Java Problem
ArrayBuffer cannot be resolved to a type DirectReadOnlyByteBuffer.java /gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/emu/java/nio line 41 Java Problem
ArrayBuffer cannot be resolved to a type DirectReadWriteByteBuffer.java /gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/emu/java/nio line 41 Java Problem
ArrayBuffer cannot be resolved to a type DirectReadWriteByteBuffer.java /gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/emu/java/nio line 49 Java Problem
ArrayBuffer cannot be resolved to a type WebGLRenderingContext.java /gdx-backends-gwt/src/com/google/gwt/webgl/client line 569 Java Problem
ArrayBuffer cannot be resolved to a type WebGLRenderingContext.java /gdx-backends-gwt/src/com/google/gwt/webgl/client line 577 Java Problem
ArrayBufferNative cannot be resolved DirectByteBuffer.java /gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/emu/java/nio line 40 Java Problem
ArrayBufferView cannot be resolved to a type DirectByteBuffer.java /gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/emu/java/nio line 52 Java Problem
ArrayBufferView cannot be resolved to a type DirectReadOnlyFloatBufferAdapter.java /gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/emu/java/nio line 138 Java Problem
ArrayBufferView cannot be resolved to a type DirectReadOnlyIntBufferAdapter.java /gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/emu/java/nio line 138 Java Problem
ArrayBufferView cannot be resolved to a type DirectReadOnlyShortBufferAdapter.java /gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/emu/java/nio line 137 Java Problem
ArrayBufferView cannot be resolved to a type DirectReadWriteFloatBufferAdapter.java /gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/emu/java/nio line 155 Java Problem
ArrayBufferView cannot be resolved to a type DirectReadWriteIntBufferAdapter.java /gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/emu/java/nio line 153 Java Problem
ArrayBufferView cannot be resolved to a type DirectReadWriteShortBufferAdapter.java /gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/emu/java/nio line 155 Java Problem
ArrayBufferView cannot be resolved to a type GwtGL20.java /gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt line 881 Java Problem
ArrayBufferView cannot be resolved to a type GwtGL20.java /gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt line 882 Java Problem
ArrayBufferView cannot be resolved to a type GwtGL20.java /gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt line 929 Java Problem
ArrayBufferView cannot be resolved to a type GwtGL20.java /gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt line 930 Java Problem
ArrayBufferView cannot be resolved to a type HasArrayBufferView.java /gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/emu/java/nio line 23 Java Problem
ArrayBufferView cannot be resolved to a type ScreenUtils.java /gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/emu/com/badlogic/gdx/utils line 89 Java Problem
ArrayBufferView cannot be resolved to a type WebGLRenderingContext.java /gdx-backends-gwt/src/com/google/gwt/webgl/client line 565 Java Problem
ArrayBufferView cannot be resolved to a type WebGLRenderingContext.java /gdx-backends-gwt/src/com/google/gwt/webgl/client line 573 Java Problem
ArrayBufferView cannot be resolved to a type WebGLRenderingContext.java /gdx-backends-gwt/src/com/google/gwt/webgl/client line 829 Java Problem
答案 0 :(得分:1)
您是否在java构建路径中添加了必需的.jars文件。
右键单击Project→Build Path→配置构建路径,在Eclipse中添加所需的jar。在Libraries选项卡下,单击Add Jars或Add External JARs并给Jar。