Rousseau was not in jail during his life. However, one of the most important moments in his life involved jail. He was visiting Diderot, the famous philosophe who had been imprisoned for impiety, when he learned about (apparently through a flyer, or pamphlet) a composition contest sponsored by the Academy at Dijon. The topic was whether the advent of science had improved the morality of mankind. Rousseau's response, which took the negative, was published as A Discourse on Arts and Sciences, brought him into prominence as a thinker.
The fact that Rousseau never spent time in jail should not obscure his reputation as an iconoclast in eighteenth century France. Part of the reason he went to Britain (at the behest of Robert Hume) in 1762 was to avoid arrest. He spent time there, and in other countries, before convincing himself that the British government was about to imprison him. He returned to France, where he was no longer viewed as controversial, and died there in 1778. While he was never actually imprisoned, he did endure a self-imposed exile, and he lived most of his life on the fringes of what was socially and legally acceptable in eighteenth-century France.