Germany announced on Thursday that it would spend $44.5 billion to quit coal — but not for another 18 years, by 2038.

The move shows how expensive it is to stop burning the world’s dirtiest fossil fuel, despite a broad consensus that keeping coal in the ground is vital to averting a climate crisis, and how politically complicated it is.

Coal, when burned, produces huge amounts of the greenhouse gas emissions that are responsible for global warming.

Germany doesn’t have shale gas, as the United States does, which has led to the rapid decline of coal use in America, despite President Trump’s support for coal. Germany also faces intense opposition to nuclear power. After the Fukushima disaster in 2011, that opposition prompted the government to start shutting down the country’s nuclear plants, a transition that should be complete by 2022.