I think you're making it too difficult for yourself
I shall explain how I did it:
- I have a client class and a server class, they have public constructors. There is NO main method in neither one of them
- I have a class called StartUp that only has 1 method: main()
That main method read the parameters the user gave in during the "java -jar runme.jar" procedure
StartUp.main() looks at the flag:
- is it SERVER, a new server object is created
- is it ALONE, a new client object is created and will start immediatly in standalone mode (I pass true or false in the client constructor so it knows which mode to run)
- is it empty, a new client object is created and will show my connection panel, which allows the user to go in local or in network mode
So my the manifest in my jar points to the startup class ... and that's it, you're done.
If you start it up, it will start client or server, depending on the flag you give. So by default the client is started.