She was the girl who got away, the one the writer of “The Catcher in the Rye” never caught.

Eugene O’Neill’s daughter, Oona, was 16 when she was introduced to a 22-year-old J.D. Salinger in 1941. A year after they started dating, he was sent to boot camp while Oona headed for Hollywood, where she became Mrs. Charlie Chaplin.

That fascinating footnote comes up in “Rebel in the Rye.” Out Friday, Danny Strong’s biopic explores the early years of Holden Caulfield’s creator. “I don’t think you could say Oona O’Neill was the love of his life,” Strong tells The Post, “but poor J.D. really fell for her.”

That she was a great playwright’s daughter was part of her allure. It was also her misfortune.

“Geniuses, for the most part, should never have children,” says Jane Scovell, author of “Oona Living in the Shadows.” She says Oona’s childhood was awful: Her mother drank and her father abandoned them when she was 2. Even so, she adored him, crying, “Daddy, Daddy,” whenever she saw his picture.

No wonder New York’s stunning, well-spoken 1942 Debutante of the Year gravitated toward older, successful men. At 17, she was not only dating Salinger, but New Yorker cartoonist Peter Arno and filmmaker Orson Welles.

Back then, Salinger was a nobody. Oona, a dark-haired, well-connected beauty, knocked his socks off.

“He was only beginning to write, and he’s dating Eugene O’Neill’s daughter and, through her, rubbing shoulders with [her friend] Gloria Vanderbilt,” says Kenneth Slawenski, author of “J.D. Salinger: A Life,” from which Strong drew for his film.

But Salinger wasn’t blind to her faults: “Little Oona is in love with little Oona,” he told the friend who introduced them.

For her part, Slawenski says, Oona believed the writer was “the greatest dancer she’d ever met.”

He also wrote wonderful letters, parts of which, Truman Capote claimed, Oona gave to her friend Carol Marcus to crib from when Carol was dating writer William Saroyan. (It worked: They wed.)

In the summer of 1942, Salinger was transferred to Georgia just as Oona moved to California. His letters to her went unanswered: Oona had met the then-53-year-old Chaplin. As soon as she turned 18, she married him.

‘Sally Hayes is Oona O’Neill. I can’t put it plainer than that.’ - Kenneth Slawenski

Salinger only found out about it when he read it in the papers.

Furious, he sent her a scathing letter imagining what her wedding night was like with a man who was reportedly being treated with monkey glands, the Viagra of the day.

Salinger went on to fight in D-Day, an experience that scarred him forever. He came home, married the first of three wives, wrote the novel that made him famous and holed up in New Hampshire until he died, in 2010.

And Oona? She bore Chaplin eight children and was with him till his death, in 1977. After that, she divided her time between their home in Switzerland and America where, Scovell says, she had affairs with Ryan O’Neal and David Bowie.

She died of pancreatic cancer in 1991, at 66. But her young self lives on, Slawenski says, as the beautiful but conventional Sally Hayes, Holden’s old flame, in “The Catcher in the Rye.”

“The character of Sally Hayes is Oona O’Neill,” Slawenski says. “I can’t put it plainer than that.”