There once was a time when Jay Z did not have it all. Flash back to late 1997: The half-a-billion-dollar fortune was closer to seven, low eight figures at best. Beyoncé was nowhere in the picture. Most astonishing of all, Jay Z, the man now considered one of the greatest rappers of all time, was not a star. He had just released his sophomore album, In My Lifetime, Vol. 1, a solid collection littered with high-highs (“Where I’m From,” “Streets Is Watching”) but also singles embodying the worst traits of late ’90s hip-hop.

Remember “(Always Be My) Sunshine?”

https://www.youtube.com/watch?v=n5egiE7TTX4

The follow-up single, “The City Is Mine,” was the 235th record released in 1997 to take a hit from the 1980s and make it sound so craaaaaazy. But this one had Blackstreet. And AutoTune. And a video with Jay Z doing a bad impersonation of Kevin Spacey in The Usual Suspects.

Most people have awkward high school yearbook photos. Jay Z has “I’m really thirsty. I used to dehydrate as a kid. It used to get really bad. My piss come out like snot … really thick and gooey.”

Adding insult to injury, he was the opening act on Puff Daddy’s No Way Out tour. But his fortunes would soon change. One night, while on the road, he heard a beat produced by The 45 King that sampled the chorus of “It’s the Hard Knock Life,” one of the best-known songs from the Broadway musical Annie. Soon after, Jay Z linked with 45 King and recorded “Hard Knock Life (Ghetto Anthem),” the record that would turn him into a mainstream star.

Officially released in October 1998, “Hard Knock Life” was Jay Z’s biggest hit to date, reaching no. 15 on the Billboard Hot 100 and pushing his third album, Vol 2 … Hard Knock Life, to more than 5.4 million copies sold. It was the beginning of one of hip-hop’s most amazing runs. With the Annie remake in theaters Friday, this is the story of Jay Z’s “Hard Knock Life,” based on original interviews and excerpts from Vibe, Jay Z’s book Decoded, and a Swedish documentary about the making of the song.

Throughout 1997, commercials promoting the 20th anniversary Broadway revival of Annie ran on television. “It’s the Hard Knock Life” was featured in the ads. One night, Mark “The 45 King” James, the producer behind “The 900 Number” and Queen Latifah’s “Ladies First,” saw the commercial and thought the show tune could work as a hip-hop record. A few days later he bought the Annie soundtrack for a quarter from a Salvation Army store. He wanted to sample the horns. Instead he heard the kids singing, “It’s the hard knock life for us.”

Danielle Brisebois (actress/singer Molly, original Broadway cast of Annie): We had a lot of fun doing “It’s the Hard Knock Life” every night. Part of the choreography was us being near the front of the stage, on our hands and knees, with the scrub brushes and the bucket, and we would always engage with the audience and break the fourth wall a little bit. I didn’t think it was a sad song. I thought it was more angry, like, “We don’t deserve this. This is bull.” Charles Strouse, as a melody maker, is an absolute genius. He also wrote Bye Bye Birdie. The songs are very infectious, and I think the melody of the song gives people hope even though the lyrics are like, these poor kids.

The 45 King (producer, “Hard Knock Life”): That’s what I do: I find stuff, then I put drums under it and come up with a bass line.

Kid Capri (DJ/producer): The 45 King put it on a plate and gave it to me. I wanted to use the beat for my album Soundtrack to the Streets. But first I wanted to test it in the arenas and get a feel from it.

The 45 King: At that time, nobody wanted to fuck with me. I went through my drug shit. From 1990 to 1991, I was out of my fucking mind. It turned into “Don’t fuck with Mark, because he is out of his mind and we don’t like his music anymore.” I’ll be honest with you: Latifah had the beat first. I sent the beat to a few people — Joe Torres, the actor, the one from BET. You know who I’m talking about? Joe Clair, there you go. But Kid Capri liked the shit.

Kid Capri: When I came out for my second set of the night on the No Way Out tour, I would start with [the instrumental version of] “Hard Knock Life.” Fans were running up saying, “How did you get the Annie song behind the drums?” It was mostly white people coming up to me. I knew from the reaction I was getting that it was really working. By the third or fourth show, Jay Z rolled up and asked me where I got that from.

Jay Z: I heard the track. I told everybody, “Hold up, wait, stop. What is that?”

Kid Capri: Jay rolled up to me like, “Yo, what’s that?” I said, “You like that?” “Yeahhh.” “You want it?” “Yeahhh.” Right there I called 45 King, while I was onstage, with the crowd watching me, and with the spotlight on me. I called 45 King and then passed the phone to Jay.

Following the December 4, 1997, show at Madison Square Garden, where his set was cut to less than 20 minutes, Jay Z quit the No Way Out tour. (On his birthday, no less! At his homecoming show! Puff, how could you?) He quickly retreated into the studio, and “Hard Knock Life (Ghetto Anthem)” was one of the first records he recorded.

The 45 King: It moved real fast. Then he did it in one take. No pen or paper, one take.

Jay Z: That’s one of the songs that was always like a conversation for me. It’s not anything to think about. The chorus already dictates where the song should go, what should be said. I probably did that song in maybe five minutes. .

Kevin Liles (former executive vice-president of The Island Def Jam Music Group): I was in a car with Jay Z, and he was playing me some of the new album. It was so different from what he did before, yet so clever. I knew it was a special record. This record wasn’t just about a moment in time, but a way of life. Anyone from the hood can relate.

DJ Enuff (Hot 97 FM): Whether we like to believe it or not, Little Orphan Annie has a real story and so did Jay Z. So many people from the inner city at the time were trying to explain or tell that same story. It just made sense. I don’t care if you are from the Fifth Ward or Marcy Projects, it made the same sense — the concept of this hard knock life we all live and we’re all striving to be in a better place.

Jay Z: I wasn’t worried about the clash between the hard lyrics and the image of redheaded Annie. Instead, I found the mirror between the two stories — that Annie’s story was mine, and mine was hers, and the song was the place where our experiences weren’t contradictions, just different dimensions of the same reality.

Kid Capri: After hearing it, the first thing I thought was, How the hell are they going to clear that [sample]?

The 45 King: No, [I didn’t think about the sample being cleared]; at that time everyone was sampling.

Jay Z: To use the song from Annie, we had to get clearance from the copyright holder. I wasn’t surprised when the company that owned the rights sent our lawyers a letter turning us down.

Martin Charnin (director and lyricist, original Broadway production of Annie): “Hard Knock Life” was done at first without my knowledge, and then it was sent to me to get permission. If the request had come without the song, I don’t think I would have done it. Saying you want to make a “ghetto anthem” is unspecific. It had to be demonstrated instead of just talked about.

Jay Z: I decided to write the company a letter myself. I made up this story about how when I was a seventh grader in Bed-Stuy, our teacher held an essay contest and the three best papers won the writer a trip to the city to see Annie. A lie. I wrote that as kids in Brooklyn we hardly ever came into the city. True. I wrote that from the moment the curtain came up I felt like I understood honey’s story. Of course, I’d never been to see Annie on Broadway. But I had seen the movie on TV. Anyway, they bought it, cleared it, and I had one of my biggest hits.

DJ Enuff: It was an instant, instant record that went right to radio. Some records need to be worked, some records need to be researched, some records need to be tested. That was one of the records that went right in, like, “Bang.”

Kevin Liles: Jay found a chemistry with a mainstream sample that allowed him to be Jay Z. The song made him accessible from Brooklyn to Arkansas to Paris to London to Germany to the world. It brought a more diverse audience and provided the platform for further acceptance to his greatness. He became more than our culture’s best-kept secret.

Kid Capri: “Hard Knock Life” opened the door for everything Jay has. Everything he is known for, that was the door opener right there.

The 45 King: If I didn’t do “Hard Knock Life,” there would have been no “Stan.”

Danielle Brisebois: It was kind of fun hearing yourself on the radio on a rap song. The bittersweet part of it was that none of us orphans got paid a penny for our vocals. It’s always been a bit of a sore spot for me. I love Jay Z. I’m a huge fan. I don’t even think it’s his fault. I think it lies more with Martin Charnin and Charles Strouse because they are the ones who could have revised our contracts. They could have given us something like a royalty for our performance. We were basically the artists on the song. We sing the whole part. There is no Jay Z on the chorus, it’s just us kids. It would have been nice if we could have gotten some kind of artist compensation, but them’s the breaks. That’s the hard knock life.

Thomas Golianopoulos (@Golianopoulos) is a writer living in New York City. He has contributed to the New York Times, BuzzFeed, Vibe, and Complex.