import org.apache.commons.math3.linear.*; public class MatrixExample { public static void main(String[] args) { double[][] coefficients = { { 2, 3 }, { 3, 4 } }; double[] constants = { 8, 10 }; RealMatrix matrix = MatrixUtils.createRealMatrix(coefficients); RealVector vector = MatrixUtils.createRealVector(constants); DecompositionSolver solver = new LUDecomposition(matrix).getSolver(); RealVector solution = solver.solve(vector); System.out.println("Solution: " + solution); } }