Java 17 class sun.security.util.DerValue does not exist
已回答
I'm using an old project, expecting it to support Java version 17, but I'm getting this error
java: package sun.security.util does not exist
I use these classes
import sun.security.util.DerInputStream;
import sun.security.util.DerOutputStream;
import sun.security.util.DerValue;
import sun.security.util.ObjectIdentifier;
我使用旧项目,希望它支持 Java 版本 17,但出现此错误
java: 包 sun.security.util 不存在
我用这些课程
请先登录再写评论。
Hi - what does the error message say if you hover over it with your mouse in the editor?
Does it suggest adding the "--add-exports java.base/sun.security.util=ALL-UNNAMED" compilation option to the current module?
I didn't see this suggestion, this is the compilation error. i ran it normally on JDK8, and this error only occured on JDK17.

Does it help if you manually add "--add-exports java.base/sun.security.util=ALL-UNNAMED" to the affected module?
I tried to add this option in Run/Debug, but it didn't work. Now i'm writting it to pom.xml and it works. Thank you so much :)
HI Can u share the pom.xml changes u did
Hi Yusufkalol - see this file for instance: