Why would a 2002 Jeep Liberty start but turn off right away on random occasions?

Chances are it is the alternator. I had a very similar problem, but I had a short in the stereo wiring. Try to start it with the radio, a/c, lights, everything off