Any d30 shafts from a non disconnect XJ, MJ, TJ, YJ, or ZJ will fit. Avoid CV joint axleshafts (some ZJs and some 84-86 XJs iirc), avoid 260 sized u-joint shafts (84-94 non ABS equipped vehicles) and the rest are fine. WJ shafts will not fit and are CV joint anyways. If you want to be lazy you can buy them with the unit bearings still installed (will cost like 10 bucks extra at the yard) which makes trail swaps easier.
8.25 - any 27 spline shaft should fit. 91-95 XJs with the 8.25 and some early 96 XJs (count the splines and make sure there are 27) as well.
If you break a front shaft:
* foot off the gas pedal IMMEDIATELY
* 36mm socket and breaker bar to loosen hub nut - easiest to do before you jack the thing off the ground. Skip this if you bought your spares with the unit bearings still installed
* jack it up, take wheel off, take brake caliper off (12 or 13mm hex head bolts)
* take rotor off (bare hands or BFH depending on rust situation)
* unscrew 3 12-point 1/2" (or 13mm) bolts behind steering knuckle. You'll need a big ratchet.
* use a sacrificial socket and a BFH, or the bolt and power steering trick to push the unit bearing out of the knuckle. If you are broken on the trail, the bolt and power steering trick will probably be dangerous because you're on a rock garden, off camber, etc.
* yank old shaft out, shove new shaft in (might have to fish out the broken off stub of the splined section if you get unlucky.)
* reassembly is reverse of removal, you curse in different spots though
If you break a rear shaft:
* foot off the gas IMMEDIATELY
* get out your drain pan, gasket scraper, 1/2" socket and ratchet, 5/16" 6 point box wrench of good manufacture
* loosen lug nuts, jack up, remove wheel, remove brake drum
* grab your drain pan, pop the diff cover, spin carrier till the cross shaft retaining bolt is in front of you. Remove it with the 5/16" wrench
* slide cross shaft out most of the way, do not spin spider gears. Push the shaft in far enough that the c clip drops off, then remove it. Install new shaft, reverse procedure...
A lubelocker or other reusable gasket on the rear diff makes a huge difference. I hate messing with RTV. A 9x12 foot sheet of 6mil painters plastic from home depot makes a huge difference too, you'll generally break in the one spot you do NOT feel like doing axle work in (rock garden, mud pit, etc... my last bad break was tranny lines punctured on a muddy, rocky hill climb.)