As Gagravarr said, the preferred solution is to deploy an AMP. You can avoid all of the hassle of setting that up yourself by using the Alfresco Maven SDK (tutorial). Then it is super easy to simply do a mvn install and it builds your AMP. You can even use mvn alfresco:install to install the AMP into your alfresco WAR and share WAR.
You may also want to look at this presentation from last year's Alfresco Summit. It shows how to use something like JRebel to do hot deploys of your Java code into your running repository.