Justice aims to restore something: to balance scales, to restore order, to limit evil, to repay a loss. Justice is meant to put things right again.
Revenge aims to harm the other person, whether through injury, or financial ruin, or lost reputation, or some other means.
We would not want to insist that "justice" never does any harm to the criminal. A thief who is ordered to repay an amount stolen -- with extra compensation -- may find himself financially ruined; but that ruin was not the goal. Restoring the loss was the goal. Justice is satisfied when things are right again. It is easy to think of cases where justice is satisfied without harm being done to the criminal. But revenge is not satisfied until some sort of harm is done.
So for justice, restoration is the goal. Harm may be permissible if it is necessary to the goal and if the goal warrants it, but not otherwise. For revenge, the harm itself is the goal.
Which is why, as the old quip said, "One is right, and the other is wrong."