简体   繁体   English

jar 不能正常工作……调试构建后?

[英]The jar doesn't work properly… debugging post-build?

I'm in the dark as to how to even attack this particular problem and I have very little information to work with.我对如何解决这个特定问题一无所知,而且我可以使用的信息很少。 Please bear with me.请耐心等待。

My current project (a trading application) runs fine from Netbeans 6.9, and the build actually runs fine.. at first.. with `java -jar "my project.jar".我当前的项目(一个交易应用程序)在 Netbeans 6.9 上运行良好,并且构建实际上运行良好......起初......使用`java -jar“my project.jar”。 It is a Swing application and everything comes up nicely.这是一个 Swing 应用程序,一切都很好。 There are no error message in the terminal window.终端窗口中没有错误消息。

However, when I engage the trading program itself (setting some of the threads into a more active state by clicking a command button), nothing happens.但是,当我使用交易程序本身(通过单击命令按钮将一些线程设置为更活跃的状态)时,没有任何反应。 No error messages in the terminal, and none of the usual messages in the application.终端中没有错误消息,应用程序中也没有常见的消息。 Like I said, it works fine from within Netbeans.就像我说的,它在 Netbeans 中运行良好。 Also, I've written other programs before using the same trading API (Interactive Brokers) and Swing, and haven't had this problem.另外,我在使用相同的交易 API(Interactive Brokers)和 Swing 之前已经编写了其他程序,并且没有遇到过这个问题。

How do I even begin troubleshooting this problem?我什至如何开始解决这个问题?

I am admittedly build-stupid, meaning I have no idea how builds work and therefore no idea how to check if it is building properly.无可否认,我是个笨蛋,这意味着我不知道构建是如何工作的,因此不知道如何检查它是否正确构建。

I've checked /dist/lib and verified all of the libraries are present.我检查了 /dist/lib 并验证了所有库都存在。

Thanks in advance for any suggestions.提前感谢您的任何建议。

This happens because your Application is throwing an exception in the background.发生这种情况是因为您的应用程序在后台抛出异常。 Try to execute your app using cmd:尝试使用 cmd 执行您的应用程序:

java -jar yourappname.jar java -jar yourappname.jar

You will see the exception in the cmd console, then you only have to fix it.您将在cmd控制台中看到异常,然后您只需修复它。

Regards问候

Like Sean says, first check the JAR file to see if everything is there.就像肖恩说的,首先检查 JAR 文件,看看是否所有东西都在那里。 Maybe the build is missing a file.也许构建缺少文件。

If that doesn't help, you can debug the application remotely.如果这没有帮助,您可以远程调试应用程序。 Here's a howto for Netbeans. 这是 Netbeans 的操作方法。

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

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