Gov. Jerry Brown was on a roll, enthusiastically preaching to a choir of environmentalists about how carbon use and global warming are a looming catastrophe for California and the world.

“Stopping carbon will be like stopping a heroin addiction,” Brown told a standing-room-only crowd at a downtown San Francisco hotel last month. “We are addicted to carbon” and something has to be done, and quickly, if the world is to be saved.

But a growing number of environmentalists argue that the governor’s long-standing refusal to ban hydraulic fracking, a controversial process that has helped revive the oil industry in California, opens the state to just the type of environmental disasters he regularly rails against.

“It’s hypocritical for Brown to call himself a climate leader,” said Catherine Garoupa White of Californians Against Fracking, a coalition of environmental groups. The governor’s support for fracking “is a huge smear on Brown’s green record.”

Fracking is a technique in which wells are injected with a chemical fluid under high pressure to fracture underground rock formations to release oil and natural gas that are otherwise unobtainable. While fracking has boosted energy production across the nation, environmentalists argue that the fluid used can threaten the water supply, that more carbon pollutants are released into the air and, more generally, that producing more oil allows people to use more oil.

“The state needs to move to an economy with 100 percent clean energy and get out of oil,” said Dan Jacobson, legislative director for Environment California. “The governor needs to play a leadership role in getting us off oil.”

That’s easier said than done, Brown said last week at a Sacramento news conference.

“As we bring down consumption, we can bring down production,” the governor said, but since California residents now drive about 330 billion miles a year, most of it in vehicles powered by gasoline or diesel, there’s a long way to go.

“California is only producing 30 percent of its oil,” Brown said. “The rest comes in ships, mostly, but increasingly in trains.”

Cutting the state’s oil production without cutting demand just means that more of California’s oil will come from other states or other countries, which may not have the strong restrictions on fracking and oil production that California now has.

“I don’t believe that makes sense,” Brown said.

That’s a nuanced argument that also recognizes the historic economic role oil plays in California, which trails only Texas and North Dakota in U.S. production.

Kern County alone pumps more oil than Oklahoma, accounting for more than 70 percent of California’s production and more than 90 percent of its fracked wells. While the miles of photogenic melon fields, almond orchards and vineyards get the magazine covers, for more than a century the county’s financial strength has been its place as California’s oil patch.

Since the 1890s, the county has been the epicenter of the state’s energy industry, with 44,284 active wells pumping some 144 million barrels of oil in 2015, according to the state Division of Oil, Gas and Geothermal Resources.

“In Kern County, oil and gas is a $4 billion industry with lots of well-paying jobs,” said Nick Ortiz, president and CEO of the Greater Bakersfield Chamber of Commerce. “It’s a huge part of our economy, and the taxes we collect are very important to Kern County and our residents.”

It’s oil giants like Chevron, Occidental and Aera Energy, which is jointly owned by affiliates of Shell and ExxonMobil, that drive the energy business in the county. Of the county’s top 10 taxpayers, eight are energy companies.

The sights and sounds of their business aren’t hard to find.

From the aptly named Panorama Park near Bakersfield College, a wooden rail fence snakes along a bluff that provides an awe-inspiring — and none-too-scenic — overview of Chevron’s sprawling Kern River oilfield, fifth largest in the nation.

For miles, the hills have been stripped of almost all vegetation, the greenery replaced by hundreds of hulking oil rigs, pump jacks moving and clanking like some giant’s teeter-totter, working 24 hours a day to pull oil from underneath Kern County.

Even the area’s lone flash of green, the willows, cottonwoods and other foliage that line the banks of the Kern River as it flows along the base of the bluff, is rudely interrupted here and there with squares of dirt, each housing a concrete pad and one or more oil rigs designed to make sure every possible drop of oil in the 16.6-square-mile field is harvested.

It’s fracking that has kept many of the county’s wells operating, said Ortiz, who worked on energy policy for the Western States Petroleum Association before joining the chamber.

“Fracking is a way to keep alive certain oil fields and access oil that’s now tightly locked,” he said. “The governor is taking a common-sense stand that recognizes we already have strict standards and stringent regulations.”

In 2013, Brown signed SB4, California’s first law regulating the use of well stimulation practices like fracking. Although fracking has been used in the state’s oil fields since the 1950s, the new law marked the first time oil companies had to report fracking to the state.

Since 2015, well operators must get a state permit before beginning fracking. The permit requires information about water and chemical usage, as well as seismic monitoring and notification of neighbors.

But for many environmentalists, that’s not enough. They argue that fracking puts Kern County residents at risk for air pollution-linked health problems like asthma, and warn that fracking fluid can infiltrate underground aquifers and ultimately contaminate the Central Valley’s fertile farmland.

Even if the pollution could be contained, extending the life of oil fields won’t solve the world’s climate problem, said Jacobson of Environment California.

“Brown’s argument is that we can do oil drilling safer than importing oil, but that’s not a good climate argument,” he said. “We need him to use his leadership and say that we’re going to leave some of that oil in the ground.”

The fracking fight has been going on for years, much to Brown’s annoyance. At the state Democratic convention in 2014, for example, his upbeat re-election speech was interrupted by climate activists shouting “No fracking” and “Ban fracking.” At other times he’s had to deal with hecklers shouting things like, “Climate leaders don’t frack.”

The governor has fought back, arguing that a fracking ban “doesn’t make a lot of sense,” and complaining that the people opposed to fracking, “don’t know what the hell they’re talking about.”

This battle with environmentalists isn’t something that would have happened during Brown’s first eight years in office, said Barbara O’Connor, a retired professor of political speech at Sacramento State University.

“He’s wiser now and realizes he can’t do everything, and the state can’t afford to do everything,” she said. “It doesn’t mean he doesn’t care, but he picks his battles.”

Brown tried to explain that Thursday, arguing that California already has a more aggressive program to fight climate change than any city or country in the Western Hemisphere.

“Certainly changes in our fracking laws are not off the table,” he said. “As we work our way through our goals, we won’t take anything off the table that will make our state cleaner, more sustainable and more healthy.”

John Wildermuth is a San Francisco Chronicle staff writer. Email: jwildermuth@sfchronicle.com Twitter: @jfwildermuth