java.lang.IllegalAccessException: Class can not access a member of class C with modifiers "private"

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

,

If you want to access functions/variables of a class from a different class they can't be private. The modifier private means that a function/variable can only be accessed from within the same class. Try the default, protected or public modifier.

,

When a member (Variables, methods, and constructors) is private, it is only accessible within the same class as it is declared. Attempting to access or instantiate it from another class would throw java.lang.IllegalAccessException exception.

Solutions on the web

via GitHub by lrytz
, 1 year ago
Class can not access a member of class C with modifiers "private"
via GitHub by DerFlash
, 2 years ago
Class com.comphenix.protocol.injector.netty.ChannelProxy can not access a member of class net.minecraft.util.io.netty.channel.SucceededChannelFuture with modifiers "public"
via GitHub by dandew
, 8 months ago
Class com.atomist.rug.spi.ReflectiveRugFunction can not access a member of class com.atomist.rug.kind.xml.XmlMutableView with modifiers "private"
via Stack Overflow by ron
, 2 years ago
Class org.eclipse.j dt.internal.jarinjarloader.JarRsrcLoader can not access a member of class WorldC ontroller with modifiers "public static"
via GitHub by eduramiba
, 1 year ago
Class fr.inria.edelweiss.semantic.SemanticWebImportMainWindowTopComponent can not access a member of class fr.inria.edelweiss.sparql.semantictweet.SemanticTweetDriverParametersPanel with modifiers ""
via GitHub by originx
, 1 year ago
Class com.tngtech.jgiven.impl.StandaloneScenarioExecutor can not access a member of class com.tngtech.jgiven.report.text.PlainTextReporterTest$FormattedSteps$ByteBuddy$7UgEFvgC with modifiers ""
java.lang.IllegalAccessException: Class can not access a member of class C with modifiers "private"
at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:102)
at java.lang.reflect.AccessibleObject.slowCheckMemberAccess(AccessibleObject.java:296)
at java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:288)
at java.lang.reflect.Field.set(Field.java:761)

Users with the same issue

3 times, 1 month ago
Once, 2 months ago
Once, 2 months ago
Once, 3 months ago
Once, 3 months ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.