Was the Afghanistan War a just war? How did the leaders justify it to their people and to the international community? What were the aims of this war?
First, we need to get a clear meaning of "Afghanistan War" and "just war." I am going to assume you mean the U.S.-led invasion of Afghanistan in November 2001 after the attacks of 9/11. By just war, you mean that the reason for going to war was just and the actions taken during that war were proportional to the attack of 9/11. I will say "yes" to both counts. The United States was attacked by a non-state actor in Al-Qaeda which was primarily headquartered in Afghanistan. Afghanistan was a terrorist state that really had no stable government to speak of after the Soviet-led invasion weakened the government there and opened the door to anti-Western extremists taking over. America wanted to wipe out the terror leaders Osama bin-Laden and his top lieutenants. It was necessary to overthrow the government there as this government was aiding and abetting these leaders. While some of the actions taken during the war have been controversial, such as drone strikes killing civilians, it is impossible to absolutely eliminate all risk to civilians in time of war. America has taken great pains by not turning the war into a war against the people but rather as a manhunt and an attempt at promoting a stable regime in the region so this does not happen again. While its actions in the region make the Afghanistan War appear to be a long-term project, its actions have been justified by the attack on American soil.