Hi.
The GlassFish app client container uses the -mainclass option to distinguish among multiple clients packaged into the same EAR so, at launch time, the user can choose which of those several clients that were packaged together to launch. As you've discovered, it does not allow the user to override the intent of the developer as to the main class to run within a given client.
You could do what you want using the alternate appclient syntax available in v3:
http://docs.sun.com/app/docs/doc/820-7701/appclient-1m?a=view
For v2 you could certainly write your single main class to accept an argument that specifies a class to be run and then load that class dynamically and invoke its main method.
-Tim
[Message sent by forum member 'tjquinn' (tjquinn)]
http://forums.java.net/jive/thread.jspa?messageID=360144