(CNN) A preliminary decision from a California superior court judge in Los Angeles could affect thousands of coffee shops including Starbucks, 7-Eleven and even your local gas station.

The shops may have to put up a warning that tells customers there is a possible cancer risk linked to their morning jolt of java. The court said in a statement Wednesday that the companies "failed to meet their burden of proof on their Alternative Significant Risk Level affirmative defense" and ruled against them.

California keeps a list of chemicals it considers possible causes of cancer. One of them is acrylamide , which is created when coffee beans are roasted. The chemical stays in the coffee you drink in what the court called a "high amount."

"It's not a final decision yet, but I do think this is big news, and I'm much relieved after eight years of work on this," said attorney Raphael Metzger. "It's a good day for public health."

The initial court documents state that, under the California Safe Drinking Water and Toxic Enforcement Act of 1986, also known as Proposition 65, businesses must give customers a "clear and reasonable warning" about the presence of high levels of this chemical, that is consider toxic and carcinogenic and can impact a drinker's health -- and that these stores failed to do so.

The coffee companies argued in court that the level of acrylamide in coffee should be considered safe under the law and that the health benefits of coffee essentially outweigh the risk. The court did not agree.

At least 13 of the defendants had settled prior to this decision and agreed to give a warning, including 7-Eleven, according to Metzger. The other coffee companies, including Starbucks, waited for a court decision.

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

The science on human exposure to acrylamide still needs "future studies," according to a 2014 review of scientific research on the chemical's relationship to a wide variety of cancers in the Journal of Nutrition and Cancer.

In addition to coffee, acrylamide can be found in potatoes and baked goods like crackers, bread and cookies, breakfast cereal, canned black olives and prune juice, although its presence is not always labeled. It's in some food packaging and is a component of tobacco smoke. According to the National Cancer Institute, people are exposed to "substantially more acrylamide from tobacco smoke than from food."

In 2002, the International Agency for Research on Cancer classified acrylamide as a group 2A carcinogen for humans based on studies done in animals. Studies done on humans have found "no statistically significant association between dietary acrylamide intake and various cancers," according to the 2014 research review.

A few additional studies have seen an increased risk for renal, ovarian and endometrial cancers; however, "the exposure assessment has been inadequate leading to potential misclassification or underestimation of exposure," according to the 2014 research review.

Even the studies showing cancer links between acrylamide in rats and mice used doses "1,000 to 100,000 times higher than the usual amounts, on a weight basis, that humans are exposed to through dietary sources," the research review said.

The National Toxicology Program's Report on Carcinogens considers acrylamide to be "reasonably anticipated to be a human carcinogen."

The Food and Drug Administration website says it "is still in the information gathering stage" on the chemical, but it suggested ways for consumers to cut it out of their diet. The FDA also provided guidance to the industry intended to suggest a range of approaches companies could use to reduce acrylamide levels. The recommendations are only a guide and are "not required," according to the website.

California added acrylamide to its carcinogen list in January 1990, and the state has successfully taken companies to court over it.

In 2008, the California attorney general settled lawsuits against Heinz, Frito-Lay, Kettle Foods and Lance Inc. when the companies agreed to reduce the levels of acrylamide found in potato chips and French fries.

In 2007, fast food restaurants in California posted acrylamide warnings about fries and paid court penalties and costs for not posting the warnings in prior years.

Follow CNN Health on Facebook and Twitter See the latest news and share your comments with CNN Health on Facebook and Twitter.

"We have a huge cancer epidemic in this country, and about a third of cancers are linked to diet, " Metzger said. "To the extent that we can get carcinogens out of the food supply, logically, we can reduce the cancer burden in this country. That's what this is all about."

Companies now have until April 10 to file objections to the proposed decision, Metzger said, and then there should be a final decision. A judge will then help decide what the penalties and remedy should be, if companies don't settle before then.