[graalvm-dev] MIgrating JNI to @CFunction

Christian Wimmer christian.wimmer at oracle.com
Sun Sep 20 21:40:19 PDT 2020


Hi,

Why would you want to migrate from JNI to @CFunction? The low-level C 
interface can be useful when you write new native-image only code, but 
if you have a working JNI implementation that you can keep it.

> If you have JNI code that you're trying to migrate to @CFunction 
> definitions, how do you know whether you're getting the bindings right? 
> Is there a way to disable JNI for a particular subset and see if the C 
> bindings are working? Or is there some other way to inspect this?

JNI and @CFunction are never overlapping. As soon as you annotate a 
function with @CFunction, no JNI call stub is created for that function.

-Christian



More information about the GraalVM-Dev mailing list