Reputation: 281
It is possible to access static Java variable from the native language.
Upvotes: 1
Views: 758
Reputation: 718788
Sure it is possible. Look at Section 4.1.3 of "The Java™ Native Interface Programmer’s Guide and Specification" by Sheng Liang .... which includes some example code.
Or the Official JNI 6.0 specification:
(I assume that you mean a static field of a Java class ... since that is the closest there is to a "global variable" in Java.)
Upvotes: 4