The Voyager mission to the outer solar system discovered that the thermospheres of all the giant planets are remarkably hot. To date, no convincing explanation for this phenomenon has been offered; however, there are a number of recent observational results which provide new information on the thermal structure of Jupiter's upper atmosphere that bear on this outstanding problem. We present an analysis of Jupiter's thermal structure using constraints from H3+ emissions, Voyager UVS occultation data, ground-based stellar occultation data, and the properties of the Jovian UV dayglow. Although the initial, separate analysis of these data sets produced contradictory results, our reanalysis shows that the observations are consistent and that the temperature profile in Jupiter's upper atmosphere is well constrained. We find that the data demand the presence of a large temperature gradient, of order 3–10 K/km, near a pressure of 0.3 μbar. Analysis of the temperature profile implies that an energy source of roughly 1 erg cm−2 s−1 is required to produce the high thermospheric temperature and that this energy must be deposited in the 0.1–1.0 μbar region. It is also necessary that this energy be deposited above the region where diffusive separation of CH4 occurs, so that the energy is not radiated away by CH4. We show that dissipation of gravity waves can supply the energy required and that this energy will be deposited in the proper region. Moreover, because the turbulent mixing caused by gravity waves determines the level at which diffusive separation of CH4 occurs, the location of the energy source (dissipation of waves) and the energy sink (radiation by CH4) are coupled. We show that the gravity waves will deposit their energy several scale heights above the CH4 layer; energy is carried downward by thermal conduction in the intervening region, causing the large temperature gradient. Thus dissipation of gravity waves appears to be a likely explanation for the high thermospheric temperature. Our arguments are general and should apply to Saturn, Uranus, and Neptune, as well as Jupiter. The model temperature profiles presented here and the relationship between the gravity wave flux and thermospheric temperature are directly testable by the Atmospheric Structure Instrument carried by the Galileo probe.