我有一个 Swing 应用程序作为 jar 文件。
我以两种方式启动应用程序。
在命令提示符下 java -jar app.jar。启动并工作正常。
双击 app.jar。启动,但未按预期正常工作。某处失败了。
会出现什么问题?
在直接运行 jar 的情况下,将打印日志(System.out.println())的位置。
我有很多系统输出。这会导致问题吗?
任何人都请在这方面提供帮助。
最佳答案
根据 Java 文档:http://download.oracle.com/javase/6/docs/api/java/lang/System.html#out
The "standard" output stream. This stream is already open and ready to accept output data. Typically this stream corresponds to display output or another output destination specified by the host environment or user.
出于日志目的,使用一些库,例如 log4j或 Java Logging .
关于Java jar 输出。它去哪儿了?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5241388/