In 1895 , military defeat forced China to cede Taiwan to Japan .