How to Solve Equations with java?
You can use determinant to calculate values of x y and z. Logic can be found out here http://www.intmath.com/Matrices-determinants/1_Determinants.php
And then you need to implement it in java using 3 dimensional arrays.
Since you're writing Java, you can use the JAMA package to solve this. I'd recommend a good LU decomposition method.
It's a simple linear algebra problem. You should be able to solve it by hand or using something like Excel pretty easily. Once you have that you can use the solution to test your program.
There's no guarantee, of course, that there is a solution. If your matrix is singular, that means there is no intersection of those three lines in 3D space.