I have written some JNI code that works just fine. I call an API out of Java which needs some environment variables set. Currently, I am working on Windows XP SP3.

I need to set a variable (Example: FOO=bar) in the user space and need to add some paths to the systems path. I need to that because I use third party DLLs in my C code which need these environment settings.

Now I am a bit stuck and don't know how to set these variables. I tried a batch file starting the Java programm, but that didn't work because I only changes the environment for that process. JNI seems to get its own process and there for not the settings I just changed.

So, does any of you have an idea how I could handle that?

Thanks for the help and regards from Germany

Marco