Chris, there's about as many options as there are styles of owners of J24.
Early solutions focused on a system of various thickness shims, which were used to block the mast both fore/aft and side to side in the partners, in order to find the "middle of the boat" where the partners cutout isn't typically standard or even centered in the boat. You can still purchase UHMP or star-board shim kits from places like APS, Defender, Hall, or other industry vendors that will work well. The trick with these is always getting them to stay still and in place tightly enough.
The more creative old school solution is custom fitted wooden blocks that fit both fore and aft, but also take into account the side to side. Break out your wood shop, and measure 10 times, cut once. Tight fit, less moving parts, once and done type solution. The chemical version of this is called SparTite, a blue goo compound that you pour into the partners after sufficiently blocking the mast in place and damming up underneath. Also available with most good racing vendors.
Finally, the more current "race" version is to build out the glass partners close to the mast so that there's just a spar section hole in the deck, built into the correct position at max J, with just enough breathing room to wiggle the mast down to the step. If you haven't played with at least some remedial deck or hull repairs, your local boat builder or repair shop could take some pictures from another well prepared boat and get the concept. If you're not 100% confident in your ability to get the mast in exactly the right spot, don't go this route. It's only reversible or corrected with a grinder or saw. An earlier/easier alternative to this is a couple of UHMP or g10 plates with a mast hold cut in them, bolted to the top of the partners once the mast is centered and at max J.
As always, a picture is worth 1000 words. Check your local, well prepared race boat, for some insight and pictures.