In 1967, he was sentenced to life imprisonment for the murder of another gangland figure, William "Babs" Rooney. During his incarceration in the special unit of Barlinnie Prison, he turned to art and wrote an autobiography, A Sense of Freedom (1977), which has since been filmed and starred David Hayman as Jimmy. Boyle has controversially maintained his innocence of the conviction.
Boyle has also published Pain of Confinement: Prison Diaries (1984), and a novel, Hero of the Underworld (1999). The latter was adapted for a French film, La Rage et le Rêve des Condamnés (The Anger and Dreams of the Condemned), and won the best documentary prize at the FifaMontreal awards in 2002. He also has written a forthcoming novel, A Stolen Smile, which is about the theft of the Mona Lisa and how it ends up hidden on a Scottish housing estate; Disney reportedly bought the film rights.