Jama is terrible for large sparse matrices.
Look at the Colt linear algebra library.
Another option for sparse linear algebra is the apache library . It may be a little easier than Colt, but the difference from the appearance of Jama may be a little more.
source share