After his education, he chose mining as an occupation. He moved to Vienna, where he befriended Wilhelm von Humboldt, the Prussian ambassador, Karl Wilhelm Friedrich von Schlegel, and other eminent literary and scientific men. Here, within the short space of fifteen months, he produced a succession of dramas, operas, and farces, as well as several small poems. The success of his works obtained him the appointment of poet to the court at the Vienna "Burgtheater". It was in this period of his life that he became betrothed to the popular actress Antonie Adamberger.