James II had a son named James Francis Edward Stuart (JFES). As the oldest legitimate male heir, he was theoretically first in line over his sisters. But being Catholic he couldn't ascend the throne.
JFES died in 1766. Before his death, William & Mary, Anne, George I,II,III ascended the throne...