简体   繁体   English

执行一些更新后,可执行文件 jar 将无法运行

[英]Executable jar file won't run after doing some updates

I am working on Java project (A terraria like sandbox game) and I have come across something that I just don't understand.我正在从事 Java 项目(类似沙盒游戏的泰拉瑞亚),我遇到了一些我不明白的事情。 I have been exporting the project as.jar's as I go along to upload and share with my friends, but the last time I did this, the.jar won't run, but when I run it in eclipse, it runs fine.我一直在把工程导出成.jar的as我go一起上传分享给朋友,但是上次做的时候.jar跑不起来,但是在eclipse运行的时候就可以了。 When I try to run the jar all it does is lose focus on the explorer window for a split second, then goes back.当我尝试运行 jar 时,它所做的只是一瞬间失去对资源管理器 window 的关注,然后返回。 I have tried many things, like changing the main class, changing the META, and moving the files to specific packages, but nothing is working.我尝试了很多东西,比如更改主 class、更改 META 以及将文件移动到特定包,但没有任何效果。

The project is 9 classes, so I won't paste all the code for it here, but the latest, non-working source code can be found here (http://www.mediafire.com/?fiw6wq73j7cff4t), the non-working jar here (http://www.mediafire.com/?bhjo162oh3hi2j9), and the working jar here (http://www.mediafire.com/?h918s8xpyxw4psr).该项目有 9 个类,所以我不会在这里粘贴所有代码,但可以在此处找到最新的非工作源代码 (http://www.mediafire.com/?fiw6wq73j7cff4t),非在此处工作 jar (http://www.mediafire.com/?bhjo162oh3hi2j9),在此处工作 jar (http://www.mediafire.com/?h918s8xpyxw4psr)。 If someone with more experience in java could please take a look at this it would be much appreciated.如果在 java 方面有更多经验的人可以看看这个,我们将不胜感激。

One of the things I tried was not adding the JPanel (the game), and just leaving the splash screen, and the jar worked.我尝试的其中一件事是不添加 JPanel(游戏),只是离开启动画面,jar 工作。 This shows that it must be a problem in the coding somewhere.这表明它一定是某处编码的问题。

Thanks for the time, ID感谢您的时间,ID

Couldn't find message comes from your ReadMap class. So check which circumstance leads to this error. Couldn't find message comes from your ReadMap class.所以检查是什么情况导致了这个错误。 Most likely you did not add all classes or other files to your JAR, so file is not found.很可能您没有将所有类或其他文件添加到您的 JAR,因此找不到文件。 Check that all needed files are added to exported JAR in Eclipse export dialog.检查所有需要的文件是否已添加到 Eclipse 导出对话框中的导出 JAR。 It's also a good idea to provide more debugging info (stacktrace is ok), especially when you are studying.提供更多调试信息也是一个好主意(stacktrace 是可以的),尤其是在你学习的时候。 BTW, cool game:)顺便说一句,很酷的游戏:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM