Pass env var from java to C ++

Is there a way to set an environment variable or some global variable in java so that it can be seen from C ++ code that I call from java (using swig). As a workaround, I can open another function that will track the value of env var in some static variable in C ++, so I can use it when necessary. However, I wonder if there is a way to set env or a global variable in java and make it visible in C ++ code called from java.

Regards -Grigor

+4
source share
1 answer

There are ways to set environment variables in Java, but they are not particularly pleasant, see the previously asked question .

I think it's best to use JNI.

+1
source

All Articles