most of the time its the AC comp that is causing the squealing. but the solution is almost never to replace the AC compressor. Try this- when you start your rig up and the squealing occurs, turn the AC off. this will usually stop the ear killing sound.
the noise is caused by the belt itself not the compressor. with the ac on it adds a lot of extra load to the belt. some times it causes the belt to slip a little bit with that extra load until the belt warms up a little bit. then the noise stops.
the most common causes of serp belt squealing is improper tension (usually the belt is loose) or the belt is getting worn out. our XJs have the tensioner on the power steering pump bracket that allows us to set the tension. for other vehicles that have an automatic tensioner (spring loaded tensioning arm) the spring may be wearing out (it is in my dodge ram)
the quickest, easiest and cheapest of the solutions is to check/adjust the tension of the belt. you can also inspect your belt. you will most likely see the smooth side is a little glazed or somewhat shinny. there may even be some cracking or deterioration on either side. check for excessive wear over the entire belt- its easiest to do with the belt off as you can bend the belt both directions looking for cracking. a small amount of cracking on the ribbed side is normal and occurs as the belt starts to wear down, but be sure there are not cracks running with the ribs as this can lead to the belt failing lengthwise with the ribs. small cracks on the smooth side can be normal as well. also check for areas where the belt may have slipped when going over any of the pulleys. you may find a build up of material on a/some pulleys either ribbed or smooth. clean the build up off the smooth pulleys with a scotch bright pad.
now you can either reinstall the old belt, or you can get a new belt and install it- a new one wont be any more difficult to do than reinstalling the old one- and use the old one as a trail spare. yes, in fact i have used my trail spare belt before after the one on it broke on the interstate.
but either way you choose, i suggest trying the cheaper items first before you replace the ac compressor.
hth
stewie