How to set arguments in weblogic via console?

49 Views Asked by At

Im trying to set arguments in weblogic ->environment->AdminServer->Server Start -> Arguments Arguments : -Denvironment=C://path

And then hit save.

From other post and documentation the value should be in JAVA_PROPERTIES, but when I try accessing it like this in my java program:

System.getenv("environment")
//Or
System.getProperty("environment")

Even printed all properties and the value is not there, is like the weblogic doesn't get updated.

Also from other post in this website it says that I need to reset the weblogic, server, node manager, but I do it and still doesn't work.

Do anybody have steps for correctly setting an argument and use it in java program, or what is the problem?

Also my JAVA_HOME and environment variables are set to the java that weblogic use

Weblogic version : 14.1.1 JAVA Version: Open Java 8(Oracle version)

I did a workaround and set it in the userOverrides.cmd script and it works, but I need to do it through console arguments.

1

There are 1 best solutions below

0
mkhosla On

To set JAVA_PROPERTIES variable, It has to imported before you start the AdminServer with startWebLogic.sh script. You can either edit the startWebLogic.sh or Make new script -> Define JAVA_PROPERTIES -> Call startWebLogic.sh script from that new script.

Then you should be able to use System.getenv("JAVA_PROPERTIES") to get value in your java program.