Hello after following the advice here Running JAR file on Windows, I’ve managed to execute my .jar application whenever I double-click on it in Windows (it is a JFrame application).
However, when an certain exceptions occurs, I do e.printstackTrace(); and generate a custom error message to the UI. When I launch the ‘.jar’ file from the command prompt, the standard error stream is the console. My question is, where does the exception trace go when I run the .jar via double-clicking?
This is a “toy” application, so I would like to avoid a logging mechanism – I only need a place to dump all exception traces for later debugging.
Thank you.
Nowhere. There’s nowhere for it to go, basically – there’s no console attached. You may want to find the user’s home directory and put a log file there, or something like that.
(Rather than using
e.printStackTrace(), I’d suggest using a proper logging framework, whether that’s log4j, java.util.logging or whatever. You say you don’t want a logging mechanism, but “a place to dump all exception traces for later debugging” sounds like logging to me…)