Question:
Cannot resolve symbol ‘BASE64Encoder’
reason:
After jdk9, the official does not support Import sun.misc.Base64encoder
.
Solution:
Method 1: reduce the JDK version to less than 1.8. (not recommended)
Method 2: use the official new jar package import java.util Base64
.
The purpose of the following Java class is to modify the corresponding coding format of the file name in different browsers to make it display Chinese correctly.
This is done with sun.misc.BASE64Encoder;
Set BASE64Encoder base64encoder = new BASE64Encoder(); Modify to Base64.Encoder encoder = Base64.getencoder();
And change the encode() method to encodeToString(). Nothing else needs to be modified.
In this way, IDEA will not report an error.
Read More:
- [Solved] Project Error: Could not found sun.misc.BASE64Encoder
- Java implementation of inputsteam to Base64
- [Solved] GRPC-Server Error: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String; CLjava
- [Solved] IDEA Error(15, 16) java Program Pack sun.misc does not exsit or import sun.misc.BASE64Decoder Cannot find
- Android Studio Cannot resolve symbol [How to Solve]
- [Solved] IDEA2020 Error: Cannot resolve symbol ‘Servlet‘
- How to Fix Error Caused by: java.util.MissingResourceException: Can‘t find bundle for base name xxx, locale zh_CN
- [Solved] IDEA JPA Custome Query Error: Can‘t resolve symbol ‘Type‘
- [Solved] Idea Build error. The symbol — Lombok cannot be found
- [Javac compilation exception] javac compilation prompts that the package in jdk cannot be found error: package jdk.internal.org.objectweb.asm does not exist and error: cannot find symbol
- [Solved] canal-adpter Startup Error: Could not resolve placeholder
- [Solved] IDEA java Cannot resolve method ‘getName‘ in ***
- Resolve warning: could’t clear Tomcat cache java.lang.NoSuchFieldException: resourceEntries
- How to Solve Tomcat Error: Could not resolve view with name ‘xxx/xxxxxxx‘ in servlet with
- HQL statement query error: could not resolve property [Solved]
- Cannot resolve reference to bean ‘sqlSessionFactory‘ while setting bean property ‘sqlSessionFactory‘
- [ERROR] Failed to execute goal on project simple-project: Could not resolve dependencies for project
- [Solved] IDEA Maven Error: Cannot resolve xxx & Maven Dependencies Error
- [Solved] IDEA Import springboot Project Error: Cannot resolve plugin org.springframework.boot:spring-boot-maven-plugin:<unknown>
- org.hibernate.exception.SQLGrammarException: could not extract ResultSet, Resolve MySQL 5.7.5 or above GROUP_BY is not supported