# java.lang.IllegalAccessError

If you're using JCloak and run into an IllegalAccessError, this usually suggests that there's an access problem with a class, field, method, or constructor that the program is trying to access during runtime. One common reason for an IllegalAccessError in the context of JCloak can be when the class being accessed is declared with package-private visibility.

Mistake
Solution
class TestClass {

    public TestClass() {
        System.out.println("Hello World");
    }
}

Ensure that the class you're trying to protect with JCloak is not declared with package-private visibility. If it's necessary for the class to be accessible only within its package, consider other solutions like creating an interface or public class that can interact with the package-private class within the same package.