1. Questions
The project reported an error: could not found sun.misc.BASE64Encoder
2. Reason
Classes such as sun.misc.BASE64Encoder are not part of the JDK standard library, but the class is included in the JDK and can be used directly.
3. Solution
Replace sun.misc.BASE64Encoder with java.util.Base64
Example:
//import sun.misc.BASE64Encoder;
import java.util.Base64;//how to solve could not found sun.misc.BASE64Encoder error
...
// return new BASE64Encoder().encodeBuffer(bytes).trim().replaceAll("\r|\n", "");
return Base64.getEncoder().encodeToString(bytes);
Read More:
- [Solved] IDEA Error(15, 16) java Program Pack sun.misc does not exsit or import sun.misc.BASE64Decoder Cannot find
- [Solved] BASE64Encoder Error: Cannot resolve symbol ‘BASE64Encoder’
- [Solved] IDEA error: sun.security.pkcs not found
- Java implementation of inputsteam to Base64
- [ERROR] Failed to execute goal on project simple-project: Could not resolve dependencies for project
- Java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver [How to Solve]
- Idea Error 404: The project ssmbuild is unavailable/the target resource cannot be found
- [Solved] GRPC-Server Error: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String; CLjava
- Mybatis Error: Invalid bound statement (not found)
- [Solved] Could not find resource COM / atguigu / Dao / studentdao.xm, the mapper file for storing SQL statements could not be found and an error occurred
- [Solved] the resource is not on the build path of a java project
- Maven Project Right-Click -update project Error [How to Solve]
- Maven (http://repo1.maven.org/maven2/): Failed to transfer file and PKIX path building failed: sun.secu
- [How to Solve] Invalid bound statement (not found)
- easy-pdf-merge Error: java: command not found [How to Solve]
- IDEA Create Web Project with maven Error: The desired archetype does not exista…
- How to Solve Mybatis error: invalid bound statement (not 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
- How to Fix Error Caused by: java.util.MissingResourceException: Can‘t find bundle for base name xxx, locale zh_CN