James II was defeated at the Battle of the Boyne in July 1690. After this defeat, he returned to France and spent the rest of his life in exile at Saint-Germain, protected by Louis XIV.
Unraveling the Reign of James II: A Royal Adventure through England's History (1685-1688)