close

[Solved] java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class

Hello Guys, How are you all? Hope You all Are Fine. Today I’m upgrading java version from java 11 to java 17. After the upgrade I am facing following error java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class in Java. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How This Error Occurs ?

I’m upgrading java version from java 11 to java 17. After the upgrade I am facing following error.

com.google.inject.internal.util.$MapMaker$StrategyImpl.compute(MapMaker.java:549) … 15 more Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class

Note: modules in the startup list are –add-opens java.base/java.lang=ALL-UNNAMED –add-opens java.base/java.util=ALL-UNNAMED –add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED

14:18:48 INFO [org.schemarepo.server.RepositoryServer ] Routing java.util.logging traffic through SLF4J Exception in thread “main” com.google.inject.internal.util.$ComputationException: java.lang.ExceptionInInitializerError at com.google.inject.internal.util.$MapMaker$StrategyImpl.compute(MapMaker.java:553) at com.google.inject.internal.util.$MapMaker$StrategyImpl.compute(MapMaker.java:419)

How To Solve java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class Error ?

  1. How To Solve java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class Error ?

    To Solve java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class Error Just add this VM param at launch: java –add-opens java.base/java.lang=ALL-UNNAMED Now, Your error must be solved.

  2. java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class

    To Solve java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class Error Just add this VM param at launch: java –add-opens java.base/java.lang=ALL-UNNAMED Now, Your error must be solved.

Solution 1: add vm param

Just add this VM param at launch.

java --add-opens java.base/java.lang=ALL-UNNAMED

Now, Your error must be solved.

Summary

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?

Also, Read

2 thoughts on “[Solved] java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class”

Leave a Comment