0

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
  • are you using node manager to start up it ? Commented Feb 15, 2024 at 15:06

1 Answer 1

0

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.