This project is a self-contained Java library for calculating the phases of the moon.
The source code is freely available on GitHub : https://github.com/SimpleAstronomy