  We present results of a detailed study of the rate of the accretion of
planetesimals by a growing proto-Jupiter in the core-accretion model. Using a
newly developed code, we accurately combine a detailed three-body trajectory
calculation with gas drag experienced during the passage of planetesimals in
the protoplanet's envelope. We find that the motion of planetesimals is excited
to the extent that encounters with the proto-planetary envelope become so fast
that ram pressure breaks up the planetesimals in most encounters. As a result,
the accretion rate is largely independent of the planetesimal size and
composition. For the case we explored of a planet forming at 5.2 AU from the
Sun in a disk with a solid surface density of 6 g/cm^2 (Lozovsky et al. 2017)
the accretion rate we compute differs in several respects from that assumed by
those authors. We find that only 4-5 M_Earth is accreted in the first 1.5x10^6
years before the onset of rapid gas accretion. Most of the mass, some 10
M_Earth, is accreted simultaneously with this rapid gas accretion. In addition,
we find that the mass accretion rate remains small, but non-zero for at least a
million years after this point, and an additional 0.3-0.4 M_Earth is accreted
during that time. This late accretion, together with a rapid infall of gas
could lead to the accreted material being mixed throughout the outer regions,
and may account for the enhancement of high-Z material in Jupiter's envelope.
