How do I load libgdx desktop app on mac osx?(如何在 mac osx 上加载 libgdx 桌面应用程序?)
问题描述
我一直在我的 Windows 7 PC 上使用 libgdx 开发一个简单的游戏.最近我买了一个macbook pro(山狮).我下载并安装了 JRE 7 和 eclipse,然后克隆并导入了项目.但是,尽管在我运行桌面版本时代码中没有错误,但 JVM 加载并迅速死亡.我在控制台中得到的错误如下:
I have been developing a simple game using libgdx on my Windows 7 PC. Recently I bought a macbook pro (mountain lion). I downloaded and installed JRE 7 and eclipse, then cloned and imported the project. However though there are no errors in the code when I run the desktop version I the JVM loads and quickly dies. The error I get in the console is as follows:
JavaVM WARNING: JAWT_GetAWT must be called after loading a JVM
_NSJVMLoadLibrary: NSAddLibrary failed for /libjawt.dylib
JavaVM FATAL: lookup of function JAWT_GetAWT failed. Exit
AL lib: ReleaseALC: 1 device not closed
我已将 JRE 7 添加到构建路径库中,但仍然不满意.
I've added JRE 7 to the build path libraries, still no joy.
桌面通过此代码启动:
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
public class Main {
public static void main(String[] args) {
LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration();
cfg.title = "colourgame";
cfg.useGL20 = false;
cfg.width = 480;
cfg.height = 800;
new LwjglApplication(new ColourGame(), cfg);
}
}
真的坚持这个.
推荐答案
据此http://lwjgl.org/forum/index.php/topic,4711.0.html问题在于 JRE 7 update 6 与 Lwjgl 的兼容性.
According to this http://lwjgl.org/forum/index.php/topic,4711.0.html problem is with compatibility of JRE 7 update 6 with Lwjgl.
问题似乎已在较新版本的库中得到修复.我不确定 libgdx 是否已相应更新,但您可以尝试将新版本放入您的 libs 文件夹中.
Problem seems to be fixed in a newer release of the library. I'm not sure if libgdx is updaetd accordingly but you can try to put the new version in your libs folder.
这篇关于如何在 mac osx 上加载 libgdx 桌面应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在 mac osx 上加载 libgdx 桌面应用程序?


基础教程推荐
- 从 python 访问 JVM 2022-01-01
- 如何在 Spring @Value 注解中正确指定默认值? 2022-01-01
- Java 实例变量在两个语句中声明和初始化 2022-01-01
- 大摇大摆的枚举 2022-01-01
- 多个组件的复杂布局 2022-01-01
- Java Swing计时器未清除 2022-01-01
- 在 Java 中创建日期的正确方法是什么? 2022-01-01
- 验证是否调用了所有 getter 方法 2022-01-01
- 不推荐使用 Api 注释的描述 2022-01-01
- 如何在 JFrame 中覆盖 windowsClosing 事件 2022-01-01