JAVA jar执行问题
当我在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您创建的 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).