His efforts were impeded by the obstruction of the clergy of Cracow, who regarded him as an adventurer; but he succeeded in reforming the university after his own mind, and was its rector for three years (1782-1785).
The churchmen headed by Stanislaus Szczepanowski, bishop of Cracow, took the side of the nobles, whose grievances seem to have been real.
At Rome too he obtained a canonry attached to Cracow cathedral, and on his return to Poland in 1755 threw himself heart and soul into the question of educational reform.
Only his superb strategy and the heroic devotion of his lieutenants - notably the converted Jew, Jan Samuel Chrzanowski, who held the Ottoman army at bay for eleven days behind the walls of Trembowla - enabled the king to remove "the pagan yoke from our shoulders"; and he returned to be crowned at Cracow on the 14th of February 1676.
Having studied at Ingolstadt, Vienna, Cracow and Paris, he returned to Ingolstadt in 1507, and in 1509 was appointed tutor to Louis and Ernest, the two younger sons of Albert the Wise, the late duke of BavariaMunich.