In Les Miserables, why does Javert kill himself?

In Les Miserables, why does Javert kill himself?