After several years of study at the Academy of Kraków, he took part in the war against the insurgents of Bohdan Khmelnytsky and participated in the battles of Zbarazh in 1649, Beresteczko in 1651, Żwaniec in 1653 and Ochmatów in 1655.