I need a custom property to set per each server JVM in Weblogic. What is the better approach doing it?
I know we can specify the argments like below:
My question is how exactly the argument is defined? How to use that argument inside the application that will be deployed inside that JVM.
Edit
If i specify, -DMyArg=MyValue
and in the code, value=System.getproperty("MyValue");
this should work, right?
-- Go to the Eclipse Window > preferences, in "Java > Installed JREs". -- Copy the current default JRE with a new name, for example myJRE. -- Select the new JRE and click on the "Edit" button. -- In the "Edit JRE" dialog, add your JVM arguments in the "Default VM Arguments" field.
Edit: if i specify, "-DMyArg=MyValue" and in the code, value=System.getproperty("MyValue"); this should work, right?
Slight mistake, you should use
value=System.getProperty("MyArg");
This however only works with NodeManager enabled. If that's not the case, what I do is to set it in the startWeblogic.cmd as one of the Java_Options
Even better is the setDomainEnv.cmd which has lines for
set EXTRA_JAVA_PROPERTIES=...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With