Solve the Problem of com.sun.org. apache. xml. internal. security. utils does not exist,
I found a lot of answers on the Internet, but my problem was not solved. After sleeping for one night, I accidentally fixed the problem and gave it to my friends who encountered the same problem.
Method 1 (eclipse ):
Answers from the online experts:
We do not recommend using com. sun for self-written programs .. This item belongs to "Deprecated and restricted API "..
In addition, various com. sun packages now have alternatives ..
If the company's old project is not available, you can use eclipse to import maven, properties-> Java Compiler-> Errors/Warnings-> Deprecated and restricted API->
Forbidden reference-> "error" to "warning"
JDK 5 can use this api. JDK 6 cannot be used later. It can only start with java or javax. (It is said that, do not take it seriously)
Method 2:
Delete:
import com.sun.org.apache.xml.internal.security.utils.Base64;
Add:
import org.apache.commons.codec.binary.Base64;
Encryption/decryption (replacement ):
Base64.encodeBase64String
Base64.decodeBase64
You can also use java 8 to import java. util. Base64.