title: Can I set an Environment Variable for Java Native Interface (JNI) libraries?
body: <p>I have a cross-platform Java application that relies on some native (C++) libraries for calling functions that perform complex scientific calculations. The native libraries are accessed using JNI (with SWIG-generated glue code). The libraries access several environment variables for configuration and location of various data tables, etc.
  I would like my Java application to be able to set these environment variables, at least in the context of the JNI libraries. This would be easy if Java provided a way to set environtment variables in it's own shell/context, but it doesn't.</p>
  
  <p>I've seen answers to <a href="https://stackoverflow.com/questions/318239/how-do-i-set-environment-variables-from-java">similar questions</a> that require changing variables for Java itself or for child processes. This question is different because it relates specifically to JNI-called code. My guess is that the situation is identical because the JNI code presumably runs in the same environment as the Java application itself. 
  However, I thought I'd ask just in case there is some JNI setting or method that could do this.</p>