Really, nationalism was the major long term cause. The competing European powers all wanted to expand their countries and achieve "Lebensraum" (living space) for their peoples. In the short term, the obvious answer is the assassination of Archduke Franz Ferdinand by a Bosnian nationalist named Gavrilo Princip. This sparked conflict between Austria and Serbia and provoked them into war. Other European powers joined in because they had formed earlier alliances with both Serbia and Austria and were forced to declare war to keep true to their pacts.
Militarism, Alliances, Nationalism, and Panslavism for long termA Sandwich(my history teacher kept saying that the assasination of Archduke Ferdinand was because of this,) blame on Serbians, and Russian sympathy for Serbia for short term.