运行libgdx样品GDX-侵略者桌面时java.lang.NoClassDefFoundError的 [英] java.lang.NoClassDefFoundError when running libgdx sample gdx-invaders for desktop

查看:199
本文介绍了运行libgdx样品GDX-侵略者桌面时java.lang.NoClassDefFoundError的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要建libgdx的GDX-侵略者样本。有两个项目:
  GDX-侵略者 - 该基地项目,它运行作为桌面Java应用程序
  GDX-侵略者-的Andr​​oid 项目 - 取决于GDX-侵略者,并运行作为一个Android应用程序

I'm building libgdx's gdx-invaders sample. There are two projects: gdx-invaders - the base project, which runs as a desktop Java application gdx-invaders-android project - depends on gdx-invaders, and runs as an Android application

我是新来使用Eclipse,但基于我能找到的最好的教程,采取适当步骤,以获得这两个项目引用相应的库(gdx.jar等),并让他们采用Android 2.2。我也试过基本修复像打扫建设之前,并重新启动Eclipse的。

I'm new to Eclipse, but based on the best tutorials I could find, took the appropriate steps to get these two projects referencing the appropriate libraries (gdx.jar, etc.), and to get them using Android 2.2. I also tried basic fixes like cleaning before building, and restarting Eclipse.

现在,GDX-入侵者建立,但它运行的时候,我得到这个运行时异常:

Now, gdx-invaders builds, but when it runs, I get this runtime exception:

Exception in thread "main" java.lang.NoClassDefFoundError: com/google/gwt/core/client/GWT
    at com.badlogic.gwtref.client.ReflectionCache.<clinit>(ReflectionCache.java:24)
    at com.badlogic.gdx.utils.reflect.ArrayReflection.newInstance(ArrayReflection.java:11)
    at com.badlogic.gdx.utils.Array.<init>(Array.java:64)
    at com.badlogic.gdx.backends.openal.OpenALAudio.<init>(OpenALAudio.java:51)
    at com.badlogic.gdx.backends.lwjgl.LwjglApplication.<init>(LwjglApplication.java:82)
    at com.badlogic.gdx.backends.lwjgl.LwjglApplication.<init>(LwjglApplication.java:64)
    at com.badlogic.gdxinvaders.GdxInvadersDesktop.main(GdxInvadersDesktop.java:27)

和GDX-侵略者,Android不建立在所有 - 它是无法参考封装com.badlogic.gdxinvaders(在GDX-侵略者定义的包),试图引用GdxInvaders时,这会导致编译器错误,一在包中定义的类。

And gdx-invaders-android does not build at all - it is unable to reference package com.badlogic.gdxinvaders (a package which is defined in gdx-invaders), which results in compiler errors when attempting to reference GdxInvaders, a class defined in that package.

构建库是从libgdx - 夜间 - 最新分布。难道你们有它是否是更好地从这里JAR文件复制到我的基地项目的lib目录下,并在这里引用罐子添加罐,还是它最好使用添加外部JAR,并在libgdx-引用它们一个preference夜间,最新的目录?

The build libraries are from a libgdx-nightly-latest distribution. Do you guys have a preference of whether it's better to copy JARs from here into my base project's lib directory, and reference the JARs here with Add Jars, or whether it's better to use Add External JARS and reference them in the libgdx-nightly-latest directory?

谢谢!
阿龙

推荐答案

您必须GDX项目添加到您的项目选项卡这是在Java构建路径。你必须包括jpct_ae.jar和jpct_shaders.zip到你的项目构建路径。

You have to add gdx project into your project tab which is in java build path. You have to include jpct_ae.jar and jpct_shaders.zip into your project build path.

这篇关于运行libgdx样品GDX-侵略者桌面时java.lang.NoClassDefFoundError的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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