He was also reportedly "happy and all right" during an event he hosted at his home in Beijing on Friday, according to a guest who attended the event.
Hecker, who was a former adviser to Germany's Chancellor Angela Merkel, arrived in China on August 1. He then spent time in quarantine before showing his credentials on August 24 to China's Foreign Ministry.
Wang Wenbin, China's Foreign Ministry spokesperson, spoke about Hecker's death at a morning briefing on Monday.
"We are shocked to learn about the sudden death of Ambassador Hecker, who had been working actively to promote China-Germany relations since assuming his post," he said.
Wang added that China was helping the embassy and Hecker's family.
Merkel also said the news of "Jan Hecker's death shocks me deeply," and that she was "full of gratitude" for working with him in the past.
"I am mourning an esteemed long-time adviser with deep humanity and outstanding expertise," she added.
The European Union and German flags are flying at half-mast at Germany's embassy in China.