JAVA_OPTS is the environment variable where servers and other Java apps append to the call which executes the java command.
For eg. in tomcat if you define JAVA_OPTS='-Xmx1024m', the script will execute java org.apache.tomcat.Servert -Xmx1024m
If you are running in Linux/OS, you can set the JAVA_OPTS, right before you call the startup script by doing
JAVA_OPTS='-Djava.awt.headless=true'
This will only be there as long as the console is open. In order to make it permanent, you can add it to your ~/.profile or ~/.bashrc file.