java.nio.charset.StandardCharsets;

 import java.nio.charset.StandardCharsets;

上边已经 导入 包 了 为什么 还会报错。

   HttpMessageConverter<?> converter = new StringHttpMessageConverter(StandardCharsets.UTF_8);

http://stackoverflow.com/questions/11277494/why-java-nio-charset-charsets-compile-error