The difference between Japan and china is one of geography.
This is a map of China.
Between themselves and the international market is a series of island archapelagoes which are hostle to it,
(A lot of this is china's fault)
In order for a slow moving tanker full of oil from the middle east to get to china it must first leave the south chinese sea.
Japan, Philipines and Taiwan are the first group of hostle islands that the chi coms have pissed off. Once this tanker gets pass them they now much go through the straits now their going past vietnam, Malaysia, Indonesia all countries that have beef with them because of their claims. After they get through this they must go past India. India has more of a naval focus and can match china on manpower and by the way also has claims against china.
Once they get past india that oil tanker must pick a side in a centuries long knife fight and now must get back through past all of those hostle countries, and in a world full of expensive oil forcing the tanker to stop and taking the oil for yourself and fucking a rival to do so makes sense when no one is protecting global trade.
Japan meanwhile has full pacific access and can more easily get oil from Canada, the US, mexico and south america yes at a higher price but there arnt any islands that can block that path. They also have worked hard to repair their relationship with Australia, the philipines, indonesia, vietnam and malasyia and are a part of that security pact which means they can leverage that to secure their oil resources.
If China had played a smarter diplomatic game this wouldn't be as bad, but the chinese communist party has made a whole host of bad decisions that are coming home to roost all at once. So their going to have a bad time.