Is violence ever justfied?

In World War 2 was violence necessary to meet the goals of the countries involved?