Instead of assuming $JAVA_HOME/bin/java, shouldn't this use a variable derived the same way $JBOSS_SCRIPT will? For example:

https://github.com/sukharevd/wildfly/blob/ede89c579701a950369912c2092228a4dd971337/build/src/main/resources/bin/standalone.sh#L112