In an interview with W magazine, Hanks - who wrote, directed and starred in the movie - revealed that he hand-picked Roberts to appear as a university professor who falls in love with his character, a middle-aged student.
"I had some teachers who looked like Julia, I would see them and think, 'I love you'," he teased. "So there was never anyone but Julia. Still, even after she said yes, I was the boss. That meant I got to say, 'You don't wear this dress, you wear that dress'. And Julia's Julia - she can be intimidating."
Also speaking to the magazine, Roberts said that Hanks encouraged her to cut loose while filming a scene that featured heavy drinking.
The actress joked: "Why did Tom Hanks think of me when he thought of a drunken schoolteacher? What does that mean? He has me chugging margaritas. I asked why it couldn't be straight liquor, and he said it was funnier if it was a drink made in a blender."
Larry Crowne is to open on July 1 in the US and the UK.
> Tom Hanks to produce Green Day film
> Julia Roberts: 'Oprah is a lifelong friend'
Watch the trailer for Larry Crowne below: