This paper presents a powerfull method to integrate general monomials on the classical groups with respect to their invariant (Haar) measure. The method has first been applied to the orthogonal group in [J. Math. Phys. 43, 3342 (2002)], and is here used to obtain similar integration formulas for the unitary and the unitary symplectic group. The integration formulas turn out to be of similar form. They are all recursive, where the recursion parameter is the number of column (row) vectors from which the elements in the monomial are taken. This is an important difference to other integration methods. The integration formulas are easily implemented in a computer algebra environment, which allows to obtain analytical expressions very efficiently. Those expressions contain the matrix dimension as a free parameter.