Search code examples
weblogic12c

setDomainEnv.sh - Append to CLASSPATH and JAVA_OPTIONS only for managed servers


I need to append certain JARs to CLASSPATH env variable only for managed servers and not admin server. Also need to add -D arguments for managed server only.

What would be the best place to do this? I am thinking of doing it in "setDomainEnv.sh" but I guess it is called for both admin and managed servers. Would I need to use $SERVER_NAME and add IF/ELSE logic to append to CLASSPATH and JAVA_OPTIONS selectively only for managed servers?

Regards Jacob


Solution

  • The recommandation from Oracle is not to modify the setDomainEnv.sh script but create a setUserOverrides.sh in the bin directory. If you read the setDomainEnv you will see it calls the the setUserOverrides if it exists. As you said, these scripts are called for both admin and managed server. So, you have to write if/else logic to set your system properties.