July 25, 1394 is the date ascribed to James I's birth by rampantscotland.com. James was born in Dunfermline to King Robert III and Anabella Drummond. James was indirectly impacted by circumstances that Walter Scott employed in his "The Fair Maid of Perth". James' older brother David was the Duke of Rothesay, who Scott has trying to abduct the maid Catherine Glover. Rothesay himself later falls afoul of his uncle Robert Stewart, the Duke of Albany, who kills him in hiscastle. In real life, Rothesay died in Albany's Falkland Castle.
In the novel and in real life, Albany was exonerated by parliament of involvement in Rothesay's death, but James' life was nonetheless considered endangered, and he was sent to France for his safety. He made it as far as Bass Rock in the Forth where he spent several months in hiding, then tried to sail to France, only to be captured and turned over to King Henry VI of England. James was detained in England for the next 18 years, before ransom was paid, and James freed.
From "The Fair Maid of Perth": 'Far different had been the fate of the misguided heir of Scotland from that which was publicly given out in the town of Falkland. His ambitious uncle had determined on his death, as the means of removing the first and most formidable barrier betwixt his own family and the throne. James, the younger son of the King, was a mere boy, who might at more leisure be easily set aside. Ramorny's views of aggrandisement, and the resentment which he had latterly entertained against his masters made him a willing agent in young Rothsay's destruction. Dwining's love of gold, and his native malignity of disposition, rendered him equally forward. It had been resolved, with the most calculating cruelty, that all means which might leave behind marks of violence were to be carefully avoided, and the extinction of life suffered to take place of itself by privation of every kind acting upon a frail and impaired constitution. The Prince of Scotland was not to be murdered, as Ramorny had expressed himself on another occasion, he was only to cease to exist. Rothsay's bedchamber in the Tower of Falkland was well adapted for the execution of such a horrible project. A small, narrow staircase, scarce known to exist, opened from thence by a trapdoor to the subterranean dungeons of the castle, through a passage by which the feudal lord was wont to visit, in private and in disguise, the inhabitants of those miserable regions. By this staircase the villains conveyed the insensible Prince to the lowest dungeon of the castle, so deep in the bowels of the earth, that no cries or groans, it was supposed, could possibly be heard, while the strength of its door and fastenings must for a long time have defied force, even if the entrance could have been discovered. Bonthron, who had been saved from the gallows for the purpose, was the willing agent of Ramorny's unparalleled cruelty to his misled and betrayed patron....'