Short answer: you can't (assuming you're truly talking C++ and not C)
I'll simplify things a bit since it seems you'd like a deeper understanding of both C++ and Java classes.
A class in C++ comprises a lot of different details, but you can think of it as a bundle of function pointers, each of which has an implicit first argument which represents the object that is an instantiation of the class. When you create an instance of that class, you get a box full of stuff that includes object data and a reference to those function pointers. Every C++ compiler puts these things together in a slightly different fashion.
You can think of the class on the Java side to have roughly the same concepts, but implemented in an entirely different way. In order to get the Java class to pretend that it's the same as a C++ class, you have to know how the native compiler put things together, and how to translate each piece of your Java class into a corresponding piece in the C++ class. Not everything translates, and while you can map a lot of common things, it's a significant amount of work and most easily done by incorporating the native compiler into the task (see JavaCPP reference below).
Other solutions exist that allow you to define classes in Java which use JNI to communicate with similarly-defined classes in C++. Unfortunately, they involve some amount of writing and/or compiling native code and glueing that to the Java bits.
SWIG
JavaCPP
Now, if you're talking about calling a function that uses only C data types (including function pointers aka callbacks), then JNA will absolutely be able to do what you want. The C language uses a well-defined method for making functions available from a shared library. As long as you know the function name and line up the arguments in the right order, you can use that shared library from just about any language. JNA uses that well-defined structure of shared libraries to automatically convert your Java primitive data types (and some composite ones like Structure
) to successfully call methods within your shared library.