The first measurement of the jet mass mjet of top quark jets produced in t t ¯ events from pp collisions at s=8TeV is reported for the jet with the largest transverse momentum pT in highly boosted hadronic top quark decays. The data sample, collected with the CMS detector, corresponds to an integrated luminosity of 19.7fb-1. The measurement is performed in the lepton+jets channel in which the products of the semileptonic decay t → b W with W → ℓν where ℓ is an electron or muon, are used to select t t ¯ events with large Lorentz boosts. The products of the fully hadronic decay t → b W with W → q q ¯ ′ are reconstructed using a single Cambridge–Aachen jet with distance parameter R= 1.2 , and pT> 400 GeV. The t t ¯ cross section as a function of mjet is unfolded at the particle level and is used to test the modelling of highly boosted top quark production. The peak position of the mjet distribution is sensitive to the top quark mass mt, and the data are used to extract a value of mt to assess this sensitivity.