Java 8,Base64.解码器编译

Java 8,Base64.解码器编译,java,maven,java-8,Java,Maven,Java 8,我正在尝试编译新的Java Base64 API,因为旧的Base64解码器已失配,但我不明白为什么会出错 这是我的密码: Base64.Decoder b64 = new Base64.getDecoder(); 我安装了最新的JavaJDK版本和maven Maven输出: Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure pl/kris14a

我正在尝试编译新的Java Base64 API,因为旧的Base64解码器已失配,但我不明白为什么会出错

这是我的密码:

Base64.Decoder b64 = new Base64.getDecoder();
我安装了最新的JavaJDK版本和maven

Maven输出:

Caused by: org.apache.maven.plugin.compiler.CompilationFailureException:      
Compilation failure
pl/kris14an/vinylrepo/ImageDecoder.java:[14,44] cannot find symbol
    symbol:   class getDecoder
    location: class java.util.Base64
ApacheMaven 3.2.5


Java版本:1.8.0_31,供应商:Oracle Corporation

这一行中不需要新的:Base64.Decoder b64=new Base64.getDecoder


Base64.getDecoder是返回解码器实例的静态方法,您不需要使用new创建它。

此行中不需要new:Base64.decoder b64=new Base64.getDecoder


Base64.getDecoder是返回解码器实例的静态方法,您不需要使用new创建它。

如此正确,它真的是大疏忽。如此正确,它真的是大疏忽。