The Happy Feet Two actor will appear alongside Mila Kunis, Game of Thrones star Peter Dinklage, James Earl Jones and fellow Oscar winner Melissa Leo in the comedy, reports Screen Daily.
The film centres around a furious man who is mistakenly told by a stand-in doctor that he has 90 minutes to live.
The surgeon sets off in hot pursuit of his patient, who leaves to right the wrongs of his life in the brief time that he has remaining.
"I read the script and said, 'Wow'," said Williams. "I love the fact that it's so fun and honest. The idea of being that nasty and funny is a gift."
The movie is a remake of 1998 Israeli film Mar Baum, which was directed by Assi Dayan.
Phil Alden Robinson (Field of Dreams) will direct the remake from Daniel Taplitz's screenplay.
Williams was first rumoured for the role late last year.
Cargo Entertainment sales chief Mark Lindsay has been introducing The Angriest Man in Brooklyn to Cannes buyers.