We present a generic matrix class facility in Java and an on-going project for a runtime en-vironment with continuous compilation aiming to support automatic parallelization of sparsecomputation on distributed environments. Our package comes with a collection of matrixclasses with a uniform interface for operations on dense and sparse matrices. These matrixoperations are implemented both for sequential and parallel executions on distributed memoryenvironments. In our environment, a program such as the conjugate gradient solver is writtenby users using high-level generic matrix notations in Java. At runtime the generic notations aremapped to specific implementations. Our approach is particularly useful for optimizing sparsecomputation for distributed environments because, with the help of profiling information and acost model, it can automatically select suitable compression and distribution schemes accordingto access patterns of the programs and non-zero structures of the matrices. Our testbed is cur-rently based on Java and PVM on an IBM SP2 workstation cluster. Preliminary experimentalresults show that our approach is promising in speeding up sparse matrix computations ondistributed memory environments.