no. (but see below)
upon death, the body becomes a corpse, or in other words, technically changes type and becomes an object.
thus the spell would fail, as it requires a creature as a target.
however, it would work if the prerequisite was set to "dying" instead of "death"... or if you could find a way for it to function as an immediate action. i say it is not an immediate action because it only works after the conditions come to pass, it cannot interrupt the conditions which cause it to trigger.
having said that, clever conditions might get around this... for example, "if an attack or spell effect is about to strike me which would cause me to die..." were the condition, but then this would not take into account spell resistance, damage resistance, or energy resistance; if the phrasing where nothing more than what i just suggested.
hmmmm. if you made the magic jar a transdimensional metaspell, then it might actually function, because it can then affect the ethereal plane where your spirit resides and thus target your spirit as a creature. this might actually be the simplest way to pull it off.