In China, which Japan invaded in 1931 and then occupied through the end of World War II, the Defense Ministry said it “strongly opposed” the latest visit to the shrine.