<s>[INST] Solve $BAB^{-1}=J$ for matrix $B$ I have 3 Matrices : $A , B$ and $J.$ I know matrices $A$ and $J. J$ is the real jordan normal form of $A.$ The relationship between the three matrices is given by $BAB^{-1} =J.$ 
How can I find the matrix $B.$
For example,
$A= \begin{bmatrix} 0 & 1 & 0 \\
     0 & 0 & 1 \\
     1 &-1 & 1 \end{bmatrix}$
$J= \begin{bmatrix} 0 & -1 & 0 \\
    1  & 0 & 0 \\
    0  & 0 & 1 \end{bmatrix}$
$BAB^{-1}=J$ can be written as $BA-JB=0$. That's as far as I got.
Thanks for your help.
 [/INST] $\det(A-\lambda I) = 0$
$-(\lambda-1)(\lambda+i)(\lambda-i)$
Complex eigenvalues 
Here is a little trick
$(B^{-1} A B)^2 = J^2\\
B^{-1} A^2 B = J^2$
And $A^2$ has real eigenvalues and the same matrices $B, B^{-1}$
$A^2 = \begin{bmatrix} 0&0&1\\1&-1&1\\1&0&1\end{bmatrix}$
and $J^2 = \begin{bmatrix}-1&0&0\\0&-1&0\\0&0&1\end{bmatrix}$
And we know that $-1,-1,1$ will be the eigenvalues of $A^2.$  Find the associated vectors.
$A^2 \begin{bmatrix}-1&0&1\\0&1&1\\1&0&1\end{bmatrix} = \begin{bmatrix}-1&0&1\\0&1&1\\1&0&1\end{bmatrix} J^2$
$B  = \begin{bmatrix}-1&0&1\\0&1&1\\1&0&1\end{bmatrix}$
And I will leave it to you to find $B^{-1}$
</s>