Technology executives are telling CNBC's Jim Cramer that they're willing to endure short-term pain from the U.S.-China trade war in favor of the long-term payoff.

"When I went out to San Francisco last week, I heard the same thing from a surprising number of people in the tech industry who do not like President [Donald] Trump one bit," the "Mad Money" host said Monday.

"What they said was 'If we're going to take on China, now's the time to do it,'" he said. "They may not be fans of the president, but they're on board with the trade war."

Part of the reason could be tied to the pain points emerging in China's economy, Cramer said. On Sunday, Chinese government data revealed that China's overall December exports fell by 4.4 percent and imports sank by 7.6 percent year over year. The data also showed the largest trade surplus with the United States in more than a decade.

"This harsher-than-expected view ... may be more realistic than you think" when it comes to how tech leaders feel about China's unfair trade practices, Cramer said.

"I think it's because the Chinese economy has never been more vulnerable than it is right now, and our economy has rarely been this strong," he explained. "If we're ever going to do anything about China, this is the perfect time. If we're ever going to stop them from forcing our companies into dubious joint ventures that represent ridiculous technology transfers and often outright theft, this is the moment."

And while no one in Silicon Valley wants to trigger a recession, "the consensus out there is that the Chinese may be forced to cave," the "Mad Money" host said.

"They export more than $500 billion worth of goods to the United States [and] only import ... less than $200 billion," he noted. "China has a lot more to lose than we do. But beyond that, a lot of these executives believe that the Chinese economy is much, much, much weaker than we think."

Cramer pointed to the various devices the Chinese government is using to keep its markets afloat, from one-year junk bonds to risky lending practices. If the United States and China part ways, China could go into a recession, he said; the United States "may not even notice."

"The reality of the situation may be that China is teetering here, something that keeps coming up in behind-the-scenes discussions with anyone who examines the People's Republic from a financial angle," Cramer said. "The trade war is not about soybeans, people; it's about balance sheets. And, believe it or not, our balance sheet is much, much, much, much better than theirs."

And while trade talks between the two countries are allegedly still ongoing, Cramer doubted that something would get done before Trump's next round of tariffs on China are instated in March.

"But, again, a surprising number of executives are willing to accept the pain, precisely because they know there can be real gain when the Chinese finally open their markets," Cramer said. "See, it's when, not if, because China's economy is actually far weaker than people seem to realize. That's why these execs want to press the bet, and you know what? I agree with them."