Violence is absolutely necessary at times. However, violence is generally necessary only when we are faced with the threat of violence ourselves.
The best example of this in terms of war might be the Holocaust. Of course, WWII was not fought to prevent the Holocaust, but that would have been a very good reason to fight. Once Hitler started trying to exterminate Jews, how could the problem be solved without fighting? Sure, you could try to persuade him to stop, but it seems pretty obvious that he would not stop just because you asked. In that case, violence is absolutely necessary as a way of protecting others.
Violence is necessary, at the very least, in cases where others have initiated the violence and you must protect yourself.