JAVA jar执行问题

发布于 2024-07-21 11:36:16 字数 187 浏览 0 评论 0原文

当我在 jidea ide 中执行应用程序时,它执行得很好。 但是当我双击 jar 文件时,它显示 gui 很好,然后我单击一个必须创建一些对象的按钮,但只创建了一些对象,在该操作中调用一些构造函数不会被调用。 但是当这在 ide 中完成时,所有构造函数都会被调用!

这种行为的原因是什么? 我该怎么做才能解决这种不同的行为?

When i execute the application in jidea ide it executes fine.
But when i double click the jar file it shows the gui fine, then i click a button which must create some objects, but only some objects created, in that action call some constructors does not called. But when this is done in the ide all the constructors called!!!

what is the reason for this behavior? what would i do to solve this different behaviors?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

︶ ̄淡然 2024-07-28 11:36:17

您创建的 jar 中可能缺少一些类。 检查你的类路径
IDE 项目并与您的系统类路径进行比较。 它们之间的任何差异都需要包含在您的 jar (或 jar-classpath)中。

You are probably missing some classes in the jar you've created. Check the classpath in your
IDE project and compare with your system classpath. Any differences between those need to be included in your jar (or you jar-classpath).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文