No simple answer for this question. Pre-flop I would say JJ, and post-flop it would depend...
So here are all the factors that I would consider when considering when to play & how to play either of those hands:
1) The style of play of the other players sitting at that table. Is it an aggressive table, passive table, etc.
2) My position in relation to the button and the other players I would consider a threat. This relates to how much information do you have and how much is still unknown.
3) What type of game you are playing (eg limit holdem, no-limit, ect)
4) What is the action already been made (eg: I actually might fold both those hands to a very big pre-flop raise from a very solid player... especially in no-limit).
5) If post-flop - how my hand ranks based on the community cards already shown. (JJ not so great if A, K, or Q comes out on flop)
6) My mental condition. (eg: am I on tilt because I just lost a huge pot to some donkey, or am I alert and on top of my game). The moment I notice I'm upset I get up and take a walk or even leave if I cant shake it, because playing while you're on tilt is fatal... :)
These are the major considerations that at minimum must be considered to effectively play either of these two hands. And there are so many variables that there is absolutely no right way to play either hand.
The skill comes in being able to adapt to the specific situation at hand on the fly. And, this skill really comes from a combination of book knowledge (reading books on poker strategy) and experience (playing alot, alot, alot of poker).
But to answer you initial question I would rather have JJ pre-flop any day. It has a small (few percentage point advantage) over AK. And over many, many, many hands that few percentage points will pay off...
Years of poker playing... lol