The Nikkei share average <.N225> ended 0.3% higher at 21,702.45 in thin trading as U.S. financial markets were closed for a national holiday on Thursday.

The broader Topix gained 0.7% to 1,589.78. Advancing issues outnumbered declining ones 1,599 to 467.

Only 822 million shares changed hands on the Topix's main board, the lowest volume since December 2011.

The U.S. trade deficit jumped to a five-month high in May and activity in the services sector slowed in June, according to data released on Wednesday.

The data followed reports on housing, manufacturing, business investment and consumer spending that point to slowing economic growth in the second quarter.

Japanese stocks were supported by optimism for a looser monetary policy in the United States, but investors were also cautious about the potential impact on the yen.

"Investors were worried that Japanese shares may suffer from a side effect of the stronger yen," said Yutaka Miura, a senior technical analyst at Mizuho Securities.

Among Thursday's gainers, shippers rallied as the Baltic Dry Index (BDI) <.BADI>, or freight charges, jumped 7.1% to a level not seen since October 2018.

"Considering that the BDI tends to reflect Chinese resource demand in real time, there would appear to be a good likelihood that commodity supply-demand will take a turn for the better, at least versus May-June," said Masanari Takada, cross asset strategist at Nomura Securities.

"The BDI does have a seasonal tendency to improve in July, but the pace of improvement this time around is quite marked," he added.

Mitsui OSK Lines gained 1.7% and Kawasaki Kisen surged 3.7%.

Nitori Holdings soared 4% after the discount furniture store operator said sales rose 6.1% to 167.3 billion yen for the March-May quarter.

Nitori's operating profit was 30.4 billion yen, about the same as the previous year and in line with market expectations.

(Editing by Darren Schuettler)

By Ayai Tomisawa