We analyze the recent LHCb measurement of the distribution of the fraction of the transverse momentum, z(J/ψ), carried by the J/ψ within a jet. LHCb data are compared with analytic calculations using the fragmenting jet function (FJF) formalism for studying J/ψ in jets. Logarithms in the FJFs are resummed using Dokshitzer-Gribov-Lipatov-Altarelli-Parisi evolution. We also convolve hard QCD partonic cross sections, showered with pythia, with leading order nonrelativistic quantum chromodynamics (NRQCD) fragmentation functions and obtain consistent results. Both approaches use madgraph to calculate the hard process that creates the jet initiating parton. These calculations give reasonable agreement with the z(J/ψ) distribution that was shown to be poorly described by default pythia simulations in the LHCb paper. We compare our predictions for the J/ψ distribution using various extractions of nonperturbative NRQCD long-distance matrix elements (LDMEs) in the literature. NRQCD calculations agree with LHCb data better than default pythia regardless of which fit to the LDMEs is used. LDMEs from fits that focus exclusively on high transverse momentum data from colliders are in good agreement with the LHCb measurement.