We present the results of a study of the accretion rate of planetesimals by a growing proto-Jupiter in the core-accretion model. Using a newly developed code, we have accurately calculated planetesimals trajectories during their passage in the envelope by combining detailed three-body integrations with gas drag. The results point to several new findings. For instance, we find that only equivalent of 4-5 Earth-masses is accreted in the first 1.5 Myr before the onset of rapid gas accretion, and approximately 10 Earth-masses is accreted simultaneously during this phase. We also find that mass accretion remains small (0.3-0.4 Earth-masses) for about 1 Myr after this time. This late accretion, together with a rapid infall of gas, could lead to a mixing of accreted material throughout the outer regions, which may explain the enhancement of high-Z material in Jupiter’s envelope. Results demonstrate that planetesimal encounters with the protoplanetary envelope become so fast that in most cases, ram pressure breaks them up. As a result, the accretion rate is largely independent of the planetesimals’ size and composition. We find that, in general, nebular gas lowers the amount of accreted planetesimals, although the majority of planetesimals are still accreted during the rapid gas accretion phase. We present present details of our calculations and discuss the implications of the results.