A couple of possibilities:
a) System.exec("sh path-to-run.sh");
b) Include bin/run.jar in your classpath and then do: org.jboss.Main.main(command-line-arguments);
Option (a) has the benefit of running JBoss AS in a separate process.
Option (b) runs JBoss AS within the same JVM that started it. This would be suitable if, for instance, you use Groovy scripts.
If you want to write a C/C++ app to run it, read up on JNI. Or even better, get the JVM source and look at how the java executable is implemented.
Does it mean that JBoss cannot be remotely started up or shutdown?
Is JBoss server a single JVM? I mean that no other admin web server to manage the other JVM or web application. If yes, every time to shutdown JBoss server and all web application will also shutdown. Is it sure. Thanks.
Remotely start - only if you have some kind of an agent on the remote system, or you remote shell into the system. Another possibility - is you are running on Windows and has JBoss AS set to start as a server you can use MMC to connect to the remote system and start the service. I think that Jopr comes with such agent.
Remotely stop - use JMX to call the shutdown() operation on the jboss.system:type=Server MBean. Several tools (twiddle, jmx console, embedded jopr, jopr) can do this for you.
Yes, JBoss AS runs in a single JVM. You can run multiple instances if you like.
What is the difference between using org.jboss.Main.main() and org.jboss.system.server.Server.start()?