Exports rose 3.9% on year after two consecutive months of declines. Exports to the European Union climbed 10.2%, in part due to a weaker yen to the euro. Exports to the U.S. grew 2.1%, and were 3.4% higher to Asian nations. Sales of motor vehicles and electrical machinery were strong.

Goldman Sachs said a recovery in the U.S. economy is pushing global demand higher, which should lead to a gradual improvement in Japan’s exports over time.

But the bank cautioned that Japan’s exports are unlikely to boom, despite the yen’s over 5% decline against the U.S. dollar in the past 12 months. In part, this is because Japanese companies have moved production to cheaper offshore bases, like China. Export volumes also have remained weak even as values have picked up.

Despite the improvement in exports, Japan’s trade balance notched a Y964 billion deficit in July, up from Y823 billion in June. (On a seasonally adjusted basis it narrowed a touch to Y1.02 trillion from Y1.08 trillion.)

In July, imports grew 2.3% on year, which was slower than 8.4% in June, the result of lower domestic demand in the wake of Japan’s April 1 sales-tax hike. But the level of imports still is relatively elevated as Japan remains dependent on overseas fuel because of delays in restarting nuclear power plants at home. The country is also importing more electrical machinery from China – an area in which it used to be only an exporter.

“Japan’s trade deficit is likely to continue,” IHS wrote in a research report.

Others are more optimistic the deficit will narrow, especially if the Bank of Japan engages in more monetary easing this year, pushing down the value of the yen. Capital Economics says such a move will choke off imports and give some lift to exports.

The latest trade figures for July point to more current-account deficits on the horizon. A structural current-account deficit would spell trouble for Japan, making it reliant on fickle – and possibly more costly — overseas capital flows to finance its enormous public debt.

The soft export outlook also means Prime Minister Shinzo Abe is going to have to rely more on boosting private consumption. Weak demand for consumer goods imports in July show this could be an uphill task.

About Real Time Economics

Real Time Economics offers exclusive news, analysis and commentary on the U.S. and global economy, central bank policy and economics. Send news items, comments and questions to the editors and reporters below or email realtimeeconomics@wsj.com.