Reflection and private native methods

I use reflection to dynamically call some methods from an extended class. Unfortunately, one of these methods is declared as private native, and as soon as I make a call ... I get the following exception:

java.lang.IllegalAccessException: Class com.something.somewhere.MyThing ca
n not access a member of class com.something.somewhere.AnotherThing with modifier
s "private native"

Is there any way around this?

+3
source share
1 answer

do you call setAccessible(true)in the method before calling it?

+6
source

All Articles