Then Joshua said to Achan, "My son, give glory to the LORD God of Israel and give praise to him. And tell me now what you have done; do not hide it from me."
Joshua 7:19

Joshua didn't hate Achan. He treated Achan with kindness even though he had caused the death of 36 men by his greed and was sentenced to be killed along with his entire family. Achan was given an opportunity to confess and his death was quick. The requirements of justice can almost always be met without cruelty.