Starbucks (SBUX) and other coffee companies need to carry a cancer warning, a Los Angeles judge has ruled. The decision comes after a nonprofit group had sued coffee roasters, distributors and retailers under a state law that requires warnings on a wide range of chemicals that can cause cancer.

One of the chemicals is acrylamide, a carcinogen present in coffee. The coffee industry had claimed the chemical was present at harmless levels and should be exempt from the law because it results naturally from the cooking process to make the beans flavorful.

But Superior Court Judge Elihu Berle said in a proposed decision Wednesday that the companies failed to show that the threat was insignificant.

Proposed California judicial decisions can be reversed but are reversed rarely.

The National Coffee Association (NCA) issued a statement saying that cancer warning labels on coffee would be misleading and that the U.S. government's own dietary guidelines state coffee can be part of a healthy lifestyle.

"Coffee has been shown, over and over again, to be a healthy beverage," William Murray, NCA's president and CEO, said in the statement. "This lawsuit has made a mockery of Prop. 65, has confused consumers and does nothing to improve public health."