Both his parents were Catholic, but some relatives on his father's as on his mother's side were Protestants. His grandfather, James Hamilton, 1st Earl of Abercorn, was a Protestant, but his father and all his paternal uncles were raised as Catholics due to the influence of his paternal grandmother, Marion Boyd, a recusant. Some branches of the Hamilton family were Protestant, such as that of his father's second cousin Gustavus, who would become the 1st Viscount Boyne. His mother's family, the Butlers, were generally Catholic with the notable exception of the future 1st Duke of Ormond, his maternal uncle. His eldest brother, James, would turn Protestant when marrying Elizabeth Colepeper in 1661, and his son, also called James Hamilton, would fight on the other side during the Siege of Derry. His brother Thomas seems to have made the same choice as he became a captain in the Royal Navy.
He and his family returned to London in 1660 after the English Restoration. Their Irish estates were returned to them and his father was created Baronet Donalong in 1660 by Charles II.
James II
John Hamilton became an officer in James II's Royal Irish Army, as did his older brothers Anthony and Richard. He stayed loyal to James at the 1688 Glorious Revolution. He seems to have gone into French exile with the King as he landed with him at Kinsale on 12 March 1689, having sailed on the ship-of-the-line Entreprenant. By June 1690 he was ranked brigadier, and was listed as one of the "Directors" left in Ireland by Tyrconnell when the latter travelled to France following the defeat at the Boyne. During the 1691 campaign in Ireland, Hamilton was involved in the Siege of Athlone, where he attempted to retake the city with two infantry brigades but failed. He was subsequently in command of the second line of infantry at the Battle of Aughrim. Seriously wounded, he was taken prisoner late in the day and died in Dublin shortly afterwards.
Marriage and daughter
In 1690 Hamilton married Elizabeth Macan of the family of the ancient Irish Lords of Clanbrassil, different from the viscounts and earls of Clanbrassill, who were Hamiltons from Scotland. The couple had a daughter Margaret, who married a Comte de Marmier in France.
Aughrim, death, and timeline
During the 1691 campaign in Ireland, Hamilton was involved in the Siege of Athlone in June, where he attempted to retake the city with two infantry brigades but failed. On 12 July 1691 at the Battle of Aughrim he commanded the second line of infantry. Seriously wounded, he was taken prisoner late in the day and died in Dublin shortly afterwards.