Use maven for builds. Modify to support java6