Stoiber was a student at Ignaz-Günther-Gymnasium in Rosenheim, where he received his Abitur (high school diploma) in 1961. He served the military with the mountain infantry division but had to leave because he hurt his knee. After his military service, Stoiber studied political science and later law in Munich. In 1967 he passed the state law exam and then worked at the University of Regensburg in criminal law and Eastern European law. He became a doctor of jurisprudence, and then in 1971 passed the second state examination.