When you deploy to JBossAS (by deploy, I mean copy to server/default/deploy), the app server will automatically start the application.
By the way, the application in question must be a Java EE application, not a Java SE application.
Examples of Java EE applications include web applications packaged in WAR file, EJBs packaged in JAR file, combinations of EJBs and web apps packaged in EAR files.
Hi Peter. Thanks for the reply. In fact, my appliaction is in JSE, not JEE. So no EJB, no WAR here. We try to run it in JBoss. I am still wondering how the server know where to start. Is there a way to start it manully?
You cannot deploy Java SE applications into JBossAS (or any app server, for that matter). You should research into how to convert your app into a service (packaged in a SAR file).
With Java EE apps, there is no concept of a "main" method.
Oh, and I hope your app does not open any windows. That will not work at all. Or at least not in the way you might expect.