如何从我的 LIBGDX 游戏中制作可执行文件

How to make an executable out of my LIBGDX game(如何从我的 LIBGDX 游戏中制作可执行文件)
本文介绍了如何从我的 LIBGDX 游戏中制作可执行文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我以前从未将程序制作成可执行文件,而且我一直在研究如何做到这一点已经有一段时间了.当我尝试将其放入 jar 中时,一切正常,但是当我尝试运行它时,没有任何反应.

I've never made a program into an executable before, and I've been looking into how to do this for some time now. When I try to put it into a jar everything works fine but when I try to run it nothing happens.

如何将我的游戏制作成可执行文件以便它可以运行(在 Windows 上,而不是在 android 上)我觉得我没有将它链接到图书馆或其他东西......不确定.谢谢!

How do I make my game into an executable so it can be run (on windows, not android) I feel like I am not Linking it to the libraries or something... Not sure. Thanks!

我应该补充一下,我得到了错误

I should add I get the error

JAR export finished with warnings. See details for additional information. 
duplicate entry: com/badlogic/gdx/utils/arial-15.fnt 
duplicate entry: com/badlogic/gdx/utils/arial-15.fnt 
duplicate entry: com/badlogic/gdx/utils/arial-15.png 
duplicate entry: com/badlogic/gdx/utils/arial-15.png 
Jar export finished with problems. 
See details for additional information. 

推荐答案

您的问题是,当您使用 eclipse export as Executable jar 文件时,它不包含您在 gdx 中使用的资产(图形、声音...)项目.您可以手动执行的操作是将您的资产文件夹复制到生成的 jar 文件旁边,或者使用您最喜欢的 zip 管理工具将您的资产文件夹包含在您的 jar 文件中.

Your problem is that when you use eclipse export as Executable jar file it does not include the assets (graphical, sounds ...) that you used in your gdx project. What you can do manually is either copy your assets folder right next to the generated jar file or include your assets folder in your jar file with your favorite zip management tool.

另一种方法是使用相同的 eclipse 导出向导并选中另存为 ANT 脚本",然后编辑生成的 ant 文件以包含您的应用所需的所有文件和文件夹.

Another way would be to use this same eclipse export wizard and check "Save as ANT script" and then edit the generated ant file to include all the files and folders needed by your app.

希望对你有帮助

这篇关于如何从我的 LIBGDX 游戏中制作可执行文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

Add Actions.scaleTo() to a Label in LibGDX(将 Actions.scaleTo() 添加到 LibGDX 中的标签)
Rotate Image Clockwise using LibGDX(使用 LibGDX 顺时针旋转图像)
When to use actors in libgdx? What are cons and pros?(何时在 libgdx 中使用演员?什么是缺点和优点?)
Libgdx Box2D pixel to meter conversion?(Libgdx Box2D 像素到米的转换?)
How do I detect if a sprite was touched in Java libGDX?(如何检测 Java libGDX 中是否触摸了精灵?)
Using scene2d.ui with libgdx: where does the skin come from?(将 scene2d.ui 与 libgdx 一起使用:皮肤从何而来?)