IIRC, Paul came up with the idea for the song while driving out to visit Cynthia and Julian during the period when John was ignoring them. He used the name Jude because Jules would be too obvious, obviously. Paul has also said that John Lennon thought that he had written it to him, about the blowback he was getting about his relationship with Yoko.
Julian has also said that Paul was the Beatle who was most considerate of him during the bad times. He would always send him birthday cards and gifts, just stayed in touch and let him know he cared.