简体   繁体   中英

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM