Hi all,
i trying to understand which is right way to update at runtime (es: during initialization) an environment variable only for jboss application context. I have a wrapper to native library that use in some applications and native library INIT method use an environment variable to update config parameters, so to use different config parameters for application i need to update an environment variable not globally but only in runtime application context so native library get right parameters for application.
I tryed to use
System.getenv().put(key, value);
but Map<String, String> returned is read only.
Could you help me ?
Thanks
You cannot update the environment of a running Java process; you must do it in the startup configuration file (e.g. standalone.conf).
See this thread for more information: Getting a live view of environment variables (Gradle and JDK 9)