Search code examples
javaweblogicsystem-properties

Weblogic set system property and use in java


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?


Solution

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