【发布时间】:2013-08-26 03:52:16
【问题描述】:
我在桌面上遇到了 LibGDX 的问题。尝试启动应用程序时,我不断收到以下错误:
Exception in thread "main" java.lang.UnsatisfiedLinkError: com.badlogic.gdx.utils.BufferUtils.newDisposableByteBuffer(I)Ljava/nio/ByteBuffer;
at com.badlogic.gdx.utils.BufferUtils.newDisposableByteBuffer(Native Method)
at com.badlogic.gdx.utils.BufferUtils.newUnsafeByteBuffer(BufferUtils.java:288)
at com.badlogic.gdx.graphics.glutils.VertexArray.<init>(VertexArray.java:62)
at com.badlogic.gdx.graphics.glutils.VertexArray.<init>(VertexArray.java:53)
at com.badlogic.gdx.graphics.Mesh.<init>(Mesh.java:148)
at com.badlogic.gdx.graphics.g2d.SpriteBatch.<init>(SpriteBatch.java:173)
at com.badlogic.gdx.graphics.g2d.SpriteBatch.<init>(SpriteBatch.java:142)
at com.badlogic.gdx.graphics.g2d.SpriteBatch.<init>(SpriteBatch.java:121)
at com.badlogic.gdx.graphics.g2d.SpriteBatch.<init>(SpriteBatch.java:115)
我的项目中添加了以下库:
- gdx.jar
- gdx-sources.jar
- gdx-natives.jar
- gdx-backend-lwjgl.jar
- gdx-backend-lwjgl-natives.jar
我错过了什么吗?
我搜索了高低,但我找到的所有内容都是针对 Android 的,并告诉我将 arm 文件夹中的 .so 库添加到我的项目中,但这对我来说对于 wintel 平台上的桌面项目没有意义.
【问题讨论】:
-
不一定要在class path中,必须在library path中,也就是说你要定义java。 library.path 系统属性,通过将其值设置为 so 文件所在目录的路径。无论是从命令行还是以编程方式,但必须在该代码尝试执行之前或UnsatisfiedLinkError is thrown。从libgdx is 的内容来看,我建议您尝试@noone 答案中的解决方案。
标签: java java-native-interface libgdx unsatisfiedlinkerror