Integrating to find a volume of revolution could be easy or hard, depending on the shape. I think the real reason several people have suggested it is more to turn you on to higher math (since you seem to be interested in that), rather than to actually, you know, solve this jar problem.
Did you see the photo of the desk lamp I posted?
Suppose you wanted to get the volume inside the lamp shade. That appears to be a segment (frustum) of a cone. You would need to measure the radius at the top of the shade, and the radius at the bottom of the shade, and there’s a geometry formula to get the volume. Formally, you could use integration, but actually, that just amounts to deriving the basic formula you already got from your geometry textbook. (That’s how a lot of those formulas can get developed anyway.)
Now suppose you wanted to get the volume of the wooden stem. It’s a volume of revolution too, but much more complicated. If you were just doing it experimentally (by measuring things), you would need to measure the radius at every height from bottom to top. Or, to get an approximation, measure the radius at one-inch intervals from bottom to top. At each inch, you could use that radius to compute the volume to the one-inch-thick disk there, and add those up.
But suppose the profile of the stem was irregular, but not THAT irregular. Suppose you could find a mathematical equation, of the form: y = (some formula with x) that, when graphed, gives you the “profile” of that shape. Then you could find the radius at every inch, or even at every millimeter, without having to actually measure it at all those places. And, with integration techniques, you could develop a formula for the volume, just starting with that y = (some formula with x) equation.
If the cross sections of the bottle are not circles (say, they are ovals or rectangular, like some of the jars in that collection of jar photos you posted), you could still do something like that. Suppose the jar was shaped like a segment (frustum) of a pyramid (like that piece of pyramid on the back of a $1 bill). Again, if you knew a formula for the area of any horizontal cross section, you could use integration to find the volume. Or, if you just took some kind of measurements at 1-inch intervals (from bottom to top) to compute the areas of those cross sections, and then the volume of the 1-inch thick slices, you could get the entire volume.
So it may, ultimately, all boil down to how mathematically straightforward the shape of the bottle is. Once you get that, you still need to deal with the efficiency of packing the candy balls into it. (Although I still like my idea of just melting them all down to fill the jar.
)