Weblogic set system property and use in java

Viktor Mellgren picture Viktor Mellgren · May 15, 2015 · Viewed 11.3k times · Source

I'm running Weblogic locally, but will run also be run in production on server instances administred from weblogic server

I have set a system property in Weblogic using, "-DRUNTIME_ENVIRONMENT=LOCALHEST" under the menu item in Servers -> Configuration-> Server start -> Arguments:

I my java file, i have System.out.println("ENVR_:" + System.getProperty("RUNTIME_ENVIRONMENT"));

And it prints null, is there some argument i have missed?

Answer

Viktor Mellgren picture Viktor Mellgren · May 20, 2015

Have to add "set JAVA_OPTIONS=%JAVA_OPTIONS% -Druntime.environment=local" to the startWebLogic.cmd file