我在Libgdx玩游戏。它现在不会在桌面版或Android上运行。当我将Main.java作为桌面应用程序运行时,它会发送这些错误..我也会发布我的代码。感谢。
错误:
Exception in thread "main" java.lang.NoClassDefFoundError: com/badlogic/gdx/graphics/GLCommon
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.<init>(LwjglApplication.java:64)
at com.ahewdev.spacepace.Main.main(Main.java:17)
Caused by: java.lang.ClassNotFoundException: com.badlogic.gdx.graphics.GLCommon
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 2 more
桌面 - Main.java代码
package com.ahewdev.spacepace;
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
import com.ahewdev.spacepace.SpacePace;
import com.badlogic.gdx.graphics.*;
import com.badlogic.gdx.setup.resources.desktop.*;
public class Main {
public static void main(String[] args) {
LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration();
cfg.title = "spacepace";
cfg.width = 480;
cfg.height = 320;
cfg.useGL20 = false;
new LwjglApplication(new SpacePace(), cfg);
}
}
编辑: