OK I presume you have a Digital Multimeter...a cheap one will do...no extreme accuracy needed.
With everything switched OFF ie. Ignition OFF. Measure the voltage on the Positive terminal of the Battery with respect to engine/chassis....you expect about +12.5 volts with a charged-up battery....should go to about 13.4 volts when engine is running.
Now with engine OFF move the meter lead off the Battery positive terminal and move it onto the large terminal on the Alternator...you should also read +12.5 volts with respect to engine /chassis as this is a single thick lead going from Alternator to Battery.
There is a catch though....this thick lead that supplies the heavy charging current to the Battery actually has a flexible Fuse built into it....called a "Fusable Link".
If this lead shorts to engine/chassis this "Fusable Link" blows to protect against fire.
So if you do not get this +12.5 volts at both ends of this thick wire..you need to buy a new fusible link...in the same color as the original. Different Jeeps have different colors for different Amp rating!
This Fusable Link can blow if it scrapes though to chassis/engine so inspect it carefully. It also gets blown when someone puts a wrench on the Alternator Terminal without first disconnecting the Battery completely and the wrench-end touches engine/chassis.
If this is not the problem, check the wires on the small connector on the Alternator going to the PCM are not scraping to engine/chassis and are firmly plugged in at both ends.
There is another cause of the Red Battery light comin ON although the battery could still be charging OK.
Underneath the Battery you may find a Battery Temperature Sensor...early KJs had this fitted...I think including the 2004 KJ. Remove the Battery and you should see this spring-load Sensor facing upwards if it exists.
You can remove this sensor and measure its resistance at Room temperature..about 200 Ohms I think.
If you heat it up with a hairdryer or an incandescant light-bulb it should change resistance...going towards about 100 Ohms if I remember correctly.
While this Sensor is disconnected...measure the supply leads to it for resistance to engine/chassis...one lead should go direct to ground while the other lead should not show ground as it enters the PCM. I do not have 2004 Wiring Diagrams so cannot tell you the wire colors.....2003 KJ Wiring shows the Ground side as Black/Light Blue. On my 2002 Export CRD I had the ground go missing on the sensor which caused the Battery Light to go ON solid...I had to add my own ground to one side.
Check these items and report back...I hope you have the correct Alternator for your Jeep!