Taiwan’s president said Friday they are not seeking military confrontation—but that they will do whatever it takes to defend their freedom, as tensions rise between the self-ruled island and its mammoth neighbor China—a strain that’s sparking alarm around the world.