There are 3 different compatibility issues to check, but all are easily overcome.
If the 242 is from an Auto Cherokee then it will probably bolt right up..
and if it from a 6 cyl cherokee you are probably o.k.
here is what to look for
23 spline input.... (that is what your 249 is)
There are 2 different input cup lengths, depending on the vehicle, some where long, and some were short, the only way to know is to pull your 249 and measure, the measure the 242.
The good news is:
Same Linkages (just need to change the bezel in the ZJ), Same driveshaft lengths (you dont need to change your driveshafts, because 242 and 249 share the same outer case dimensions)
Overall you have a pretty good chance that it will bolt right in.
If it is a 21 spline unit you can swap your input cup from your 249 into the 242 after a little minor surgery of the cases
1997 ZJ, knobby tires and stuff..