War is a very grey area with no easy, and certainly no correct answer to it. And as such, war should not be treated as something that actually has an answer, but more of a process to lessen it's occurrence.
If we want to talk about war in an idealistic way, then we have to first look at the world in an idealistic way, and approach the attitudes of all humans in an idealistic way. To do this, we should first look at one society, and see how that behaves, before moving on to a bigger society such as an entire country, and ultimately the world. In said society, in a perfect world, people would all get along nicely, and would be able to pursue their dreams and goals without conflict, without strife. Nobody would be flawed, and every goal would be for the further benefit of society and development. These people would help and support one another equally, and no one would be better off than another, everybody living in total equality. Then if we broaden this view to a country, the same applies, but the country would support its differing counties and states equally, ensuring that every state and county is equal, and receives an equal amount of support. Pushing this into a wider viewing frame, when applied to the world the same would happen. Countries would support each other to develop, to be equal and not be prejudiced against one another. All countries would share benefits equally, and all humans would be able to live safe under the knowledge that everything is equal and sound.
Now let's be realistic about this. There is no place in this world in which disparity cannot be witnessed. You go to any town, any minor or major city and you will see the wealthy stroll past the poor every single day. The homeless will beg those with a home, the starving will be ignored by the satisfied. States and counties will be favoured by the government, depending on which one will in turn bring the government the most money. Third World countries that were shit upon through debts and technology disparities are still being shit upon by the First World. People are not equal, and never will be. Why are you in your education system? To achieve grades that will help you towards a good job, to earn money to survive. And what happens when someone not particularly good in factual areas is very creative and has genius ideas? They're kicked to the side, because they will not favour the system, they will not benefit the system they live in. This same thing happens to countries.
When a country does not comply with the system to hand, the countries with power will kick it to the side, and punish it for doing so. When a country steps out of line and does something wrong, those who oppose this view will attack, just as society does to those who don't conform.
Whilst all people want freedom and the ability to believe in what they choose, and follow the morals they choose, and whilst disparity still exists in this world, there will always be war. Freedom, ideals and money go hand in hand in hand. And if one link is missing, the chain collapses and the system disintegrates into a process of expulsion and punishment. And when this occurs in a large scale between countries, the punishment is war. The biggest piece of evidence for this is World War II. Hitler stepped out of line, disagreeing with the system. He lashed out, and the Allied Forces retaliated, crushing Hitler and putting Germany back into place. The same is happening in the Middle East, as we attempt to form a world that conforms to the rules those with power set. Of course, this is just one part of an argument that goes deeper into money and so on. There are many more sides to this, but I shan't list them now. Instead, I will conclude with this.
War will forever be the action taken to achieve greater power. As such, it will never become obsolete while humans have the free will to chase their own desires.