How did imperialism nationalism and militarism lead to war in 1914?

Imperialism, nationalism and militarism were all political situations that European countries were dealing with. They were taking over each other's territories, building up their defenses and had people that were so loyal to their own nation they would do anythng for their own country. This is where the assination of Archduke Franz Ferdinand comes in. An extreme-nationalist, Gavrilo Princip shot him and his wife, Sophie. Everyone started blaming each other and a war resulted.