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 不存在

我用这些课程

0

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?

1

I didn't see this suggestion, this is the compilation error. i ran it normally on JDK8, and this error only occured on JDK17.

0

Does it help if you manually add "--add-exports java.base/sun.security.util=ALL-UNNAMED" to the affected module?

1
Does it help if you add "--add-exports java.base/sun.security.util=ALL-UNNAMED" to the current module?
0

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 :)

0

HI Can u share the pom.xml changes u did

0

请先登录再写评论。