Mary was born at St. James Palace in London on 30 April 1662 . Her father was James , Duke of York , and her mother was his first wife , Lady Anne Hyde . Mary , born at St. James 's Palace in London on 30 April 1662 , was the eldest daughter of James , Duke of York ( the future James II & VII ) , and his first wife , Lady Anne Hyde .