It will, instead, cause the process to be terminated. WARNING: Using CTRL+Break will not work with the -Xrs JVM argument, since the -Xrs flag causes SIGQUIT and SIGWAITING signals to be ignored.
For example: java MyJavaClass > C:\MyLogs\console.log 2>&1 If the JVM is not being started by a shell script, or the shell script is being launched by another process, the same redirection can be added directly to the command that is starting the JVM. If console.log already exists, it will be overwritten. In the above case, the console's standard output and standard error display is being redirected to a file named console.log located in C:\MyLogs. For example: run.bat > C:\MyLogs\console.log 2>&1 cmd file), console output can normally be redirected by adding > console.log 2>&1 to the end of the command used to launch the shell script. If the JVM is being launched by a shell script (.bat or. Therefore, it may be necessary to increase the size of the scroll-back buffer to capture the entire thread dump.Īlternatively, the JVM can be started with its output redirected to a file. This output is normally very large and will overflow the console window's scroll-back buffer.
If console output has not been redirected, the thread dump will be printed to the console. If the JVM was started from a command prompt or console, the thread dump can be triggered by selecting the console window in which the JVM is running and pressing CTRL+Break.
#Java cmd c how to#
How to get a thread dump from a Java process running on a Windows machine?.