Japan has accelerated plans to devote 2 percent of its GDP — and more — to its military as China grows more assertive and the U.S. urges allies to spend bigger.