(CNN) California coffee shops may soon be forced to warn customers about a possible cancer risk linked to their morning jolt of java.

The state keeps a list of chemicals it considers possible causes of cancer, and one of them, acrylamide , is created when coffee beans are roasted.

The 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 agents that affect health -- and that these stores failed to do so.

In addition to paying fines, the lawsuit wants companies to post warnings about acrylamide with an explanation about the potential risks of drinking coffee. If the suit is successful, the signs would need to be clearly posted at store counters or on walls where someone could easily see them when making a purchase.

Raphael Metzger, the attorney representing the nonprofit, said it really wants the coffee companies to reduce the amount of the chemical to the point where there would be no significant cancer risk.

Photos: Coffee's health history Photos: Coffee's health history It's thumbs up today, but the news on coffee has not always been positive. Take a look at the arguments for and against coffee through the centuries. Hide Caption 1 of 15 Photos: Coffee's health history 1500s headline: Coffee makes you frisky – Legend has it that coffee was discovered by Kaldi, an Ethiopian goatherd, after he caught his suddenly frisky goats eating glossy green leaves and red berries and then tried it for himself. Hide Caption 2 of 15 Photos: Coffee's health history 1500s headline: Coffee leads to illegal sex – But it was the Arabs who started coffeehouses, and that's where coffee got its first black mark. Patrons of coffeehouses were said to be more likely to gamble and engage in "criminally unorthodox sexual situations," according to author Ralph Hattox Hide Caption 3 of 15 Photos: Coffee's health history 1600s headline: Coffee cures alcoholism – As the popularity of coffee grew and spread, the medical community began to extol its benefits. It was especially popular in England as a cure for alcoholism, one of the biggest medical problems of the time. Hide Caption 4 of 15 Photos: Coffee's health history 1600s headline: Coffee cures all? – This 1652 ad by London coffee shop owner Pasqua Rosée popularized coffee's healthy status, claiming that coffee could aid digestion, prevent and cure gout and scurvy, help coughs, headaches and stomachaches, and even prevent miscarriages. Hide Caption 5 of 15 Photos: Coffee's health history 1700s headline: Coffee helps you work longer – By 1730, tea had replaced coffee in London as the daily drink of choice. That preference continued in the colonies until 1773, when the famous Boston Tea Party made it unpatriotic to drink tea. Coffee houses popped up everywhere, and the marvelous stimulant qualities of the brew were said to contribute to the ability of the colonists to work longer hours. Hide Caption 6 of 15 Photos: Coffee's health history 1800s headline: Coffee shortage – In the mid-1800s, America was at war with itself, and one side effect was that coffee supplies ran short. Enter toasted grain-based beverage substitutes such as Kellogg's "Caramel Coffee" and C.W. Post's "Postum" (still manufactured), which advertised with anti-coffee tirades to boost sales. Hide Caption 7 of 15 Photos: Coffee's health history 1800s headline: Coffee will make you go blind – Postum's ads against coffee were especially negative, claiming that coffee was as bad as morphine, cocaine, nicotine or strychnine and could cause blindness. Hide Caption 8 of 15 Photos: Coffee's health history 1916 headline: Coffee stunts your growth –

Medical concerns and negative public beliefs about the benefits of coffee rose in the early 1900s. Good Housekeeping magazine wrote about how coffee stunts growth Hide Caption 9 of 15 Photos: Coffee's health history 1927 headline: Coffee will give you bad grades, kids – In a 1927 Science magazine article, 80,000 elementary and junior high kids were asked about their coffee drinking habits. Researchers found the "startling" fact that most of them drank more than a cup of coffee a day, which was compared with scholarship with mostly negative results. Hide Caption 10 of 15 Photos: Coffee's health history 1970s headline: Coffee is as serious as a heart attack –



And a In 1978, the same year Baseball Hall of Famer Joe DiMaggio began selling Mr. Coffee on TV, a New England Journal of Medicine study found a short-term rise in blood pressure after three cups of coffee.And a 1973 study found that drinking one to five cups of coffee a day increased risk of heart attacks by 60%, while drinking six or more cups a day doubled that risk to 120%. Hide Caption 11 of 15 Photos: Coffee's health history 2000 era headline: Time for meta-analysis –



But first, a couple of negatives: A



And a 2010 Now begins the era of the meta-analysis, in which researchers look at hundreds of studies and apply scientific principles to find those which do the best job of randomizing and controlling for compounding factors, such as smoking. The results for coffee: mostly good.But first, a couple of negatives: A 2001 study found a 20% increase in risk of urinary tract cancer for coffee drinkers but not tea drinkers. That finding was repeated in a 2015 meta-analysis . So if this is a risk factor in your family history, you might want to switch to tea.And a 2010 meta-analysis found a correlation between coffee consumption and lung disease, but the study found it impossible to completely eliminate the confounding effects of smoking. Hide Caption 12 of 15 Photos: Coffee's health history 2007-2013 headlines: Coffee reduces risk of stroke and some cancers –



This



As for prostate cancer, a meta-analysis of 11 studies on the link between stroke risk and coffee consumption between 1966 and 2011, with nearly a half a million participants, found no negative connection. And a 2012 meta-analysis of studies between 2001 and 2011 found four or more cups a day had a preventative effect on your risk for stroke.This meta-analysis showed that drinking two cups of black coffee a day could reduce the risk of liver cancer by 43%. Those findings were replicated in 2013 in two other studies. As for prostate cancer, a 2011 study followed nearly 59,000 men from 1986 to 2006 and found drinking coffee to be highly associated with lower risk for the lethal form of the disease. Hide Caption 13 of 15 Photos: Coffee's health history



And overall heart disease? A A similar analysis of studies on heart failure found four cups a day provided the lowest risk for heart failure, and you had to drink a whopping 10 cups a day to get a bad association.And overall heart disease? A meta-analysis of 36 studies with more than 1.2 million participants found that moderate coffee drinking seemed to be associated with a low risk for heart disease; plus, there wasn't a higher risk among those who drank more than five cups a day. Hide Caption 14 of 15 Photos: Coffee's health history 2015 headline: Coffee is practically a health food –



And as a sign of the times, in 2015, the How about coffee's effects on your overall risk of death? One 2013 analysis of 20 studies , and another that included 17 studies , both of which included more than a million people, found that drinking coffee reduced your total mortality risk slightly.And as a sign of the times, in 2015, the US Department of Agriculture agreed that "coffee can be incorporated into a healthy lifestyle," especially if you stay within three and five cups a day (a maximum of 400 milligrams of caffeine) and avoid fattening cream and sugar. You can read its analysis of data here. Hide Caption 15 of 15

"I'm addicted to coffee, I confess, and I would like to be able to have mine without acrylamide," Metzger said.

At a bench trial last fall, the coffee companies argued 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.

At least 13 of the defendants have settled and agreed to give a warning, most recently 7-Eleven, according to Metzger. The convenience store chain did not respond to requests for comment.

The other manufacturers would have to follow suit if they don't settle the lawsuit and if the judge finds that they violated state laws. Metzger said private mediation with the remaining retailers is set for February 8. It will include nine of the defendants, and the parties will try to come to an agreement about the case. Otherwise, a judge would probably reach a decision this year.

BP did not return requests for comment.

Starbucks referred questions to the National Coffee Association , the industry's trade association, which said it was not in a position to comment on the litigation.

Bill Murray, the association's president and CEO, said in a statement, "Coffee has been shown, over and over again, to be a healthy beverage. The US Government's own Dietary Guidelines state that coffee can be part of a healthy lifestyle. This lawsuit simply confuses consumers, and has the potential to make a mockery of Prop 65 cancer warning at a time when the public needs clear and accurate information about health."

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.

studies have seen an increased risk A few additionalstudies have seen an increased risk for rena l, 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.

considers acrylamide to be "reasonably anticipated to be a human carcinogen." 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 the FDA gave consumers suggested ways 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

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

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.