As per the wishes of his cousin King Christian VIII, Prince Johann first enlisted in the Prussian military in 1842 and upon his graduation was appointed Second Lieutenant of the 27th Prussian Infantry Regiment in Magdeburg. He studied at the University of Bonn before joining the Dragoon Guards Regiments in Berlin. He participated in the German revolutions of 1848–1849 and the First Schleswig War against Denmark; this conflict of loyalties between Prussia and Denmark prompted him to request exemption from service. He went on to serve in various departments and was promoted to "Rittmeister" in 1854. The following year he was appointed Major "à la suite" and went to Denmark, settling down in Copenhagen.