 Hek was the son of a shopkeeper (of Dutch origin) from Dobruška.He received his primary education in Dobruška and in Prague (from 1779) and from 1782 he studied at a Piarists gymnasium in Prague.In Prague, Hek met the Czech patriots concentrated around Václav Matěj Kramerius' publishing house "Česká expedice" and around the Czech theatre groups.