James II was King of Majorca and Lord of Montpellier from 1276 until his death. He was the second son of James I of Aragon and his wife, Violant, daughter of Andrew II of Hungary. In 1279, by the Treaty of Perpignan, he became a vassal of the Crown of Aragon.