I am trying to set up some environment variables for my standalone JBoss EAP 6 instance, but the code does not seem to pick it up.
Here is what I had to do in my startjboss.sh for JBoss EAP 5:
export MYSPECIALIP=127.0.0.1
nohup run.sh
In JBoss EAP 6, in domain mode, I changed host.xml file on my host to include the following:
<jvms>
<jvm name="default">
<environment-variables>
<variable name="MYSPECIALIP" value="127.0.0.1"/>
</environment-variables>
<heap size="64m" max-size="256m"/>
<permgen size="256m" max-size="256m"/>
<jvm-options>
<option value="-server"/>
</jvm-options>
</jvm>
</jvms>
Now, I would like to know how to do it for JBoss EAP 6 standalone mode? So far I tried to add it in standalone.conf alongside Java options, but it did not work.
JAVA_OPTS="-Xmx3g -Xms3g -XX:MaxPermSize=256m $JAVA_OPTS"
MYSPECIALIP=127.0.0.1
Best Answer
1.Go to /home/user/.bash_profile
a. Edit .bash_profile and make entries of name-value pairs
b. Also these entries must be exported by prefixing "export" infront of these name of name-value pair as
2.Make entries of these name-value pairs in standalone.xml with "env." notation as prefix
NOTE : "$" represents environtmental variable
3.Run bash profile as . ./.bash_profile
4.Run JBoss in standalone mode as ./standalone.sh