Have you tried creating a Covariance matrix directly from your data?
new Covariance().computeCovarianceMatrix(data)
Using the information in the comment, we know that there are 3 independent, 1 dependent variables and 200 samples. That implies that you will have a data array with 4 columns and 200 rows. The end result will look something like this (typing everything out explicitly in order to try to explain what I mean):
double [] data = new double [4][];
data[0] = new double[]{y[0], x[0][0], x[1][0], x[2][0]};
data[1] = new double[]{y[1], x[0][1], x[1][1], x[2][1]};
data[2] = new double[]{y[2], x[0][2], x[1][2], x[2][2]};
// ... etc.
data[199] = new double[]{y[199], x[0][199], x[1][199], x[2][199]};
Covariance covariance = new Covariance().computeCovarianceMatrix(data);
double [][] omega = covariance.getCovarianceMatrix().getData();
Then, when you're doing your actual regression, you have your covariance matrix:
MultipleLinearRegression regression = new GLSMultipleLinearRegression();
// Assumes you put your independent variables in x and dependent in y
// Also assumes that you made your covariance matrix as shown above
regression.addData(y, x, omega); // we do need covariance