如何使可执行文件从我的LIBGDX游戏 [英] How to make an executable out of my LIBGDX game

查看:118
本文介绍了如何使可执行文件从我的LIBGDX游戏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从来没有做了一个程序到可执行文件之前,我一直在寻找到如何做这方面的一段时间。当我试图把它放进一个罐子里一切工作正常,但是当我尝试运行它没有任何反应。

我如何让我的游戏转换为可执行,因此可以运行(在Windows上,而不是机器人) 我觉得我没有将它链接到图书馆或什么...不知道。 谢谢!

编辑: 我要补充我的错误

  JAR出口有警告结束。查看详情了解更多信息。
重复的条目:COM / badlogic / GDX / utils的/宋体,15.fnt
重复的条目:COM / badlogic / GDX / utils的/宋体,15.fnt
重复的条目:COM / badlogic / GDX / utils的/宋体,15.png
重复的条目:COM / badlogic / GDX / utils的/宋体,15.png
罐出口完成的问题。
查看详情了解更多信息。
 

解决方案

您的问题是,当你使用Eclipse导出为可执行的JAR文件不包含资产(图形,声音...)您在GDX使用项目。你可以手工做的就是可以复制你的资产文件夹旁边的生成jar文件或包含您的资产文件夹在你喜欢的压缩管理工具,您的jar文件。

另一种方法是使用相同的Eclipse导出向导,并选中保存为ANT脚本,然后编辑生成的Ant文件,包括所有需要你的应用程序中的文件和文件夹。

希望这有助于

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.

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!

Edit: 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. 

解决方案

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.

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.

Hope this helps

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

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