执行 jar 文件时 OpenGL 应用程序屏幕出现乱码
我使用 Intellij 的“build jar”选项为我的(OpenGL)应用程序创建了一个 jar 文件。
当我尝试执行 jar 文件时,它会启动应用程序屏幕,并显示正确的应用程序标题和屏幕尺寸。
然而,屏幕内部全是“乱码”:有些部分是空白的,有些部分有线条和/或像素。
请注意,当通过 Intellij 执行时,应用程序运行正常。
有谁知道可能是什么问题?
我尝试将jar文件发送给朋友,他说他的电脑也出现同样的问题。这可能与我们的计算机丢失有关吗?
有谁知道我是否需要调整 IDE 的一些选项?
文件系统中是否有一个地方可以尝试找到错误日志文件来帮助我调试这个文件?
提前致谢。
I created a jar file for my (OpenGL) application using Intellij's "build jar" option.
When I try to execute the jar file, it launches the application screen, with the proper application title and screen sizes.
However, the inside of the screen is all "garbled": some parts are blank, others have lines and/or pixels.
Note that the application runs properly, when executed via Intellij.
Does anyone have any idea what might be the problem?
I tried sending the jar file to a friend, and he said that the same problem occurs in his computer. Could this be related to missing in our computers?
Does anyone know if I need to tweak some of the IDE's options?
Is there a place in the file system where I can try to find an error-log-file which will help me debug this?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了一个解决方案。
在 Intellij IDEA 10.5 中,我转到:文件 ->项目结构->文物-> jar
并验证右侧栏中是否有一些“可用元素”。
其中之一是我的项目,它有一个用于“资产”的子“文件夹”。所以我使用“放入输出目录”将它们添加到 jar 中。
然后我重建了 jar 文件并尝试执行它。这很成功。
我猜这个问题与丢失“资产”(即图像)有关。之前的 .jar 文件不包含这些图像,而新文件则包含这些图像。
谢谢。
I found a solution for this.
In Intellij IDEA 10.5, I went to: File -> Project Structure -> Artifacts -> Jar
and verified that there some "Available Elements" in the right side column.
One of those was my project, which had a sub "folder" for its "assets". So I added these to the jar, using "Put into output directory".
Then I rebuilt the jar file and attempted to execute it. This was sucessful.
I'm guessing the problem was related to missing "assets" (i.e. images). The previous .jar file did not contain those images and the new one does.
Thanks.