If Jesus is telling us clearly in Matthew 26:52 that whoever lives by the sword, then why?

Jesus says clearly in Matthew 26:52 that whoever picks up the sword or todays times "gun", will perish by the sword. Then how is signing up for the army pleasing to God and his son Jesus?
God clearly tells us that vengeance is his. So, shouldn't we allow him to settle matters?
4 answers 4