Adam was born on 3 July 1728 at Gladney House in Kirkcaldy, Fife, the second son of Mary Robertson (1699–1761), the daughter of William Robertson of Gladney, and architect William Adam. As a child he was noted as having a "feeble constitution". From 1734 at the age of six Adam attended the Royal High School, Edinburgh where he learned Latin (from the second year lessons were conducted in Latin) until he was 15, he was taught to read works by Virgil, Horace, Sallust and parts of Cicero and in his final year Livy. In autumn 1743 he matriculated at the University of Edinburgh, and compulsory classes for all students were: the Greek language, logic, metaphysics and natural philosophy. Students could choose three elective subjects, Adam attended classes in mathematics, taught by Colin Maclaurin, and anatomy, taught by Alexander Monro "primus". His studies were interrupted by the arrival of Bonnie Prince Charlie and his Highlanders, who occupied Edinburgh during the 1745 Jacobite rising. At the end of the year, Robert fell seriously ill for some months, and it seems unlikely that he returned to university, having completed only two years of study.