Are you referring to OSGi services or front end components that you drag from the sidekick? \
AEM components are built in tools likes like CRXDE lite, Eclipse, etc. Read the AEM Components documentation:
http://docs.adobe.com/docs/en/cq/5-6-1/developing/components.html
Custom AEM OSGi services can be built different ways too. You can create them in Eclipse, CRXDE (not recommended anymore), Maven, etc, We have different articles that show different ways.
CQ projects are typically created using Maven Archetypes:
http://docs.adobe.com/docs/en/cq/5-6-1/developing/developmenttools/howto-develop-aem-projects-using-...