I am new to Java and am making a license generator. This is my current setup.
com.example.licensegenerator.client (used by the client application)
:LicenseLoader (no Main method)
:LicenseDownloader (no Main method)
com.example.licensegenerator.server.keys (used by the server)
:ProductKeyGenerator(Main method)
com.example.licensegenerator.server.license (used on the server also)
:LicenseGenerator(Main method)
com.example.licensegenerator.lib (Shared classes between client and server)
:Contants (no main)
Now I have a few questions.
Is it OK to have multiple main() methods in a single project? Will I be able to compile them to different .jar files? (In this case I need two different jars for the server)
Is there a better way to setup the packages?
And a totally unrelated question, with exceptions, is it better to handle them right then and there or throw them and let the main method catch them all (the program cannot recover if an error occurs)