James was King of England and Ireland as James II, and King of Scotland as James VII,from 6 February 1685 until he was deposed in the Glorious Revolution of 1688. He was the last Catholic monarch of England, Scotland and Ireland; his reign is now remembered primarily for struggles over religious tolerance. However, it also involved the principles of absolutism and divine right of kings, and his deposition ended a century of political and civil strife by confirming the primacy of Parliament over the Crown.
Leading members of the English political class invited William of Orange to assume the English throne; after he landed in Brixham on 5 November 1688, James's army deserted, and he went into exile in France on 23 December. In February 1689, a special Convention Parliament held that the king had "vacated" the English throne and installed William and Mary as joint monarchs, establishing the principle that sovereignty derived from Parliament, not birth. James landed in Ireland on 14 March 1689 in an attempt to recover his kingdoms, but despite a simultaneous rising in Scotland, in April a Scottish Convention followed that of England by finding that James had "forfeited" the throne and offered it to William and Mary. After his defeat at the Battle of the Boyne in July 1690, James returned to France, where he spent the rest of his life in exile at Saint-Germain, protected by Louis XIV (Wikipedia).