在Eclipse之外时,可运行的导出JAR无法正常运行 [英] Runnable exported JAR not running as it should when out of Eclipse

查看:66
本文介绍了在Eclipse之外时,可运行的导出JAR无法正常运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我从IDE,Eclipse将项目导出到可运行的JAR时,程序无法正常运行.

When I export my project from my IDE, Eclipse into a runnable JAR the program does not work as it should.

启动时应显示什么,以及从Eclipse启动时应显示什么:

What should appear when launched and what appears when launched from Eclipse:

导出后启动程序时会显示什么:

What appears when the program is launched after exporting:

如您所见,它似乎并没有按预期的方式工作,并且由于我现在已经进行了一段时间,所以请保持语言简洁以便于理解.

As you can see it does not seem to work as it should and as I've only been doing this for a while now please keep the language simple so I can understand.

工作原理:

编辑说明

我在一些地方放了一些showMessageDialog,看会弹出什么,是否会弹出带有数字的数字,以便知道哪个和一个从游戏类的中间弹出,而不是我放在顶部的那个.

I put a few showMessageDialog in a few places to see what would popup and if anything would popup with numbers to know which ones and one popped up from middle of the game class but not the one I put at the top.

推荐答案

此问题可能与以下事实有关:您在游戏中使用了图像,但图像不包含在jar中.

This issue probably relates to the fact that you use images in your game but they are not included in your jar.

如果不使用此处介绍的方法访问图像,则需要:缺少图像/文件(资源)的可运行JAR

If you are not accessing your images using the method described here, you need to: Runnable JARs missing Images/Files (Resources)

这篇关于在Eclipse之外时,可运行的导出JAR无法正常运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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