recipeNoD002 - Debugging JNI code with IntelliJ/CLion

By: JNI Cookbook

10   0   1200

Uploaded on 05/16/2016

You are free to:

Share — copy and redistribute the material in any medium or format
Adapt — remix, transform, and build upon the material
for any purpose, even commercially.
The licensor cannot revoke these freedoms as long as you follow the license terms.

Under the following terms:

Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.
No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.


You do not have to comply with the license for elements of the material in the public domain or where your use is permitted by an applicable exception or limitation.
No warranties are given. The license may not give you all of the permissions necessary for your intended use. For example, other rights such as publicity, privacy, or moral rights may limit how you use the material.

Dj Rkod - Pulse (George Ellinas Remix) by George Ellinas - published under CC (ccMixter)

IntelliJ and CLion used in this tutorial was granted with Open Source based license.

JNI Cook Book:

Comments (5):

By anonymous    2017-09-20

Use IntelliJ ;)

This way, you can easily debug JNI ;)

Original Thread

By anonymous    2017-09-20

If you want to take a look at exact chain of execution I suggest to connect to JVM using gdb (or CLion) and take a look at backtrace.

Take a look here to see how to do it:

You can also take a look here:

Once you are attached to JVM, you can set breakpoint in your C code and check the backtrace from top to bottom.

Alternatively, you can create SIGSEGV and generate full backtrace of JVM (take a look here:

Original Thread

By anonymous    2018-01-29

The answer for this one is already been published in the link you've provided which is ``. Also the method behind the android studio is explained here, Android Studio 1.3+ supports native debugging so you need only the PID of the process, in the first part of the vdo he's obtaining the PID of the process.

Original Thread

Submit Your Video

If you have some great dev videos to share, please fill out this form.