反思与私人本土方法

Pas*_*ass 3 java reflection

我使用反射从扩展类动态调用一些方法.不幸的是,其中一个方法被声明为私有本机,并且一旦我进行调用...我收到以下异常:

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"
Run Code Online (Sandbox Code Playgroud)

有没有解决的办法?

jta*_*orn 6

setAccessible(true)在调用它之前调用方法吗?