1. Create a new auto.sh file under /xuj/java/activemq/bin/ and enter the following content
#!/bin/sh
export JAVA_HOME=/xuj/java/java7
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH =.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
/xuj/java/activemq/bin/activemq start
2. Give auto.sh execute permission
3. Add the following content to the /etc/rc.local file
/xuj/java/activemq/bin/auto.sh &