1

I am getting error with JDK 11

class javax.crypto.JceSecurity (in unnamed module @0x256bb5be) cannot access class jdk.internal.util.StaticProperty (in module java.base) because module java.base does not export jdk.internal.util to unnamed module @0x256bb5be

Subham
  • 420
  • 3
  • 11
  • 34

1 Answers1

1

Java 9 introduced concept of modules. Classes to be visible outside the modules, needed to be exported. You can do it on module definition or on command line.

To do it on command line, you need to use parameter

--add-exports <source-module>/<package>=<target-module>(,<target-module>)*

As you are using maven, then according to https://blog.codefx.org/tools/maven-on-java-9/ you need to create file .mvn/jvm.config in your projects folder and put options inside. For error you are experiencing content of the file should be:

--add-exports java.base/jdk.internal.util=ALL-UNNAMED
user902383
  • 8,420
  • 8
  • 43
  • 63