If an error log location isn't specified when executing java -cp ../blah someplace/somejar.jar
where would the jvm error log be written to?
What do you mean by "jvm error"? If you refer to stack-traces, these are written to System.err
which leads to the standard error stream
. This is typically printed in your terminal, just as System.out
is. You can redirect this if you want, either when calling the JVM (using 2> /my/file.log
) or from within your code by redirecting System.err
.
Some logging frameworks redirect the std-error, then it depends on your configuration.
If you refer to JVM Crash logs (which are created if the JVM crashes, which should never happen if you do not use JNI, but in fact they sometimes occur) the situation is different. These are typically created in the folder where the jvm was launched. If this folder is not writable, the /tmp
directory is used on Unix-Systems.
According to Java Platform, Standard Edition Troubleshooting Guide: Location of Fatal Error Log, the system attempts to create the file in the working directory of the process if the -XX:ErrorFile=file
flag is not specified.
In the event that the file cannot be created in the working directory (insufficient space, permission problem, or other issue), the file is created in the temporary directory for the operating system.
On Oracle Solaris and Linux operating systems the temporary directory is /tmp
.
On Windows the temporary directory is specified by the value of the TMP
environment variable; if that environment variable is not defined, the value of the TEMP
environment variable is used.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With