It's shell script after all (run.sh
). Most recent value is picked up. You can try it for yourself.
Create a file run.sh
with following content
#!/bin/bash
JAVA_OPTS="Before"
JAVA_OPTS="After"
echo $JAVA_OPTS
and run it ./run.sh
and you should get "After" in the console. Nothing JBoss specific.
So to answer your question -Xmx1024
will be picked up. And to answer your question so as to how to check you can use programs like jconsole
to view your java process and check your maximum memory allocated (as you have provided in -Xmx option). You can also do something like ps -ax | grep java
to see the Java process and the JAVA_OPTS it used.