The driveshafts connect to the transfer case, which is bolted to the transmission. Since different transmissions are different dimensions, the transfer case will have a physically different offset depending on the transmission in use, and as a result the front driveshafts are different lengths depending on the transmission in the donor vehicle. This is true for every vehicle that was offered with multiple powertrain options (including the ZJ).
For example, an AX5 manual trans is physically shorter than the AX15, which is shorter than the AW4. Since the transfer case is bolted to the transmission, it will be further forward on an AX5 than the others, and as a result the front driveshaft will be shorter than one from the others too.
Really you have to measure and then find a driveshaft that fits. For most people with an AW4 the front driveshaft is close enough to be used on the rear after an SYE conversion, but not always. Different types of SYE conversions will have different size issues, as will installation choices, year of the XJ involved, etc.