M
M
mr_blond972017-05-21 15:40:56
linux
mr_blond97, 2017-05-21 15:40:56

How to use cat to write an Exception that occurs to a file?

When the application starts, an Exception occurs, it can be read in the console. How can I use cat to write this Exception to a file?
I tried to do this, but the Exception is not written to the file:

$ cat | java -jar ./myapp.jar > cattest.log
Exception in thread "LWJGL Application" java.lang.UnsatisfiedLinkError: Can't load library: /var/folders/gp/.../liblwjgl.dylib

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Melkij, 2017-05-21
@mr_blond97

Errors are usually written to stderr, and you only redirect stdout.
cmd 2> stderr_stream

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question