简体   繁体   中英

Differences in Java invocation between running application from Eclipse vs. from command line

I observe a bug in a Java application, which only occurs when I run the application from the system command line, but not when I run the application from within Eclipse Mars. I hope that knowing about the technical differences between these ways to start the application will help me find the bug.

So my question is: Are there any special things Eclipse does when starting an application, eg setting additional VM arguments? And can I somehow reproduce the way Eclipse runs an application when I start it from the command line?

Edit:

I had encoding issues, ie some non-ASCII characters were displayed correctly while running the application in Eclipse but not while running from the command line. I found out that the code relied on the default system character set being UTF-8, which is obviously incorrect (I run Windows with Latin1). When running from Eclipse on the same computer, however, Java's default character set is set to UTF-8. For this reason, I could not reproduce the bug in the IDE. I finally ran the program from a shell and used remote debugging to find the bug.

在命令行中运行程序与在 IDE 中运行程序之间存在巨大差异。(但请记住,您可以在命令行中实现 IDE 的所有功能)对于 Eclipse,您可以阅读http:/ /help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2FgettingStarted%2Fqs-12.htm

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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