Everyone is influenced by family during the developmental years, and John Fitzgerald Kennedy certainly had interesting and powerful influences.
Kennedy's family immigrated from Ireland, an identity that became closely associated with him (with all the Kennedys), especially during his political career. Even more importantly, his father and grandfather were active in the political arena, another thing which clearly shaped Kennedy's way of looking at the world and how the political system could have an impact on worldwide problems.
Kennedy also came from significant wealth, something which certainly shapes how one sees others and the world. His first book was published while he attended Harvard, largely because of his father's friends' influence.
Kennedy was sick a lot during his early years, something which can have a profound influence on many areas of one's life. After serving in the military (another influence) and doing heroic service as the commander of a PT Boat (where he both lost and saved his men), Kennedy took an interest in foreign policy. He had the means to travel and see for himself what was happening around the world.
Kennedy came from a particularly large family and his father placed high expectations on all of his children. Kennedy had a mentally disabled sister, which gave him compassion in that area, and an older brother who died too early to carry on the family's political legacy. Someone had to step into that role, and John Fitzgerald Kennedy was the chosen one. Fortunately, his interests suited his career.
The Kennedy wealth and position allowed him to see and experience things first-hand, but that would not have been enough to make a successful President. Kennedy also had an inquisitive mind and was a creative thinker; his position in life and his family allowed him to use those two gifts to their full potential.