0

I am getting this error while running my springboot application.

Unable to make private java.time.LocalDateTime(java.time.LocalDate,java.time.LocalTime) accessible: module java.base does not "opens java.time" to unnamed module

I have tried adding --add-opens java.base/java.time=ALL-UNNAMED in default VM arguments but it doesn't worked. Please help me with the solution.

harsh agarwal
  • 43
  • 2
  • 8
  • Does this answer your question? [How to fix the ''module java.base does not "opens java.io" to unnamed module '' error in Android Studio?](https://stackoverflow.com/questions/67782975/how-to-fix-the-module-java-base-does-not-opens-java-io-to-unnamed-module) – He3lixxx Sep 02 '23 at 00:45

1 Answers1

0

Try to convert your application into a named module by creating a module-info.java file and explicitly declaring the module's dependencies and exports.

By doing so, you can control the module's accessibility to other modules. You can then open the java.time package to your named module in the module-info.java file.

Or if you are using third-party libraries or frameworks, the error might be caused by a dependency conflict. Make sure all your dependencies are compatible with each other and with the Java version you are using. Updating your dependencies to their latest versions might resolve the issue.

ahuemmer
  • 1,653
  • 9
  • 22
  • 29