IntelliJ Idea doesn't show jni stdout in run window
Answered
Editor's run window doesn't show jni stdout, when usual cmd shows everything. I am printing to stdout with printf.
Windows 10, IntelliJ IDEA 2017.3, JNI code compiled with Visual Studio 2017.
Please sign in to leave a comment.
Please share a sample project to reproduce it.
Okay, it's something mythical. When i tried to create example project i realized that this is happens only when i use JNI and netty. So i guess it's netty's problem but it's working normally in usual cmd. Example > https://yadi.sk/d/pm_GNLqF3S85fP
This may be caused by the threading issues. You may need to wait until all the threads are finished before exiting the app. Also native and Java outputs are not synchronized, so it's normal if native output is displayed after the java output even if the order is the opposite, with your example I get the following:
But if you try to run it with usual cmd the output will be normal. (At least i have normal output)