...
Java: Create a nativ method
C++: Create a matching implementation
Store the C++ implementation inside a shared library
Compile the shared library with CMake
Load the shared library with System.LoadLibrary()
Call the JNI method
Note: When a Java native method is called before the implementation is loaded it leads to a crash!
More details about more complex data transfer can be found in the following topics:
Low level: C++ and JNI data transfer
High level: C++ and JNI data transfer
...