We extend the molecular structural mechanics approach to the study of the specific heat of carbon nanotubes. The vibrational modes of the nanotube are quantized according to the theory of quantum mechanics. The partition function is directly expressed by the vibrational frequencies of carbon atoms. The specific heat of finite-length individual single-walled carbon nanotubes is calculated and the temperature dependence of the specific heat is demonstrated. The specific heat is shown to increase with increasing tube diameter, but the effect mainly exists at the temperature range of $25--350\phantom{\rule{0.3em}{0ex}}\mathrm{K}$. The tube chirality has a slight influence on the specific heat at high temperature. The specific heat is also shown to increase with increasing tube length when the nanotube length/diameter ratio is less than 20, and the effect is more distinguishable at higher temperature. The computational predictions are compared with available experimental as well as theoretical results of the specific heat of carbon nanotubes.