Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reflection and Private Native Methods

I am using reflection to dynamically call some methods from extended class. Unfortunately one of these methods is declared as private native and as soon as I make the call... I receive 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 a way around this?

like image 212
Pass Avatar asked Sep 13 '26 18:09

Pass


1 Answers

are you calling setAccessible(true) on the Method before invoking it?

like image 133
jtahlborn Avatar answered Sep 16 '26 16:09

jtahlborn