drip icon indicating copy to clipboard operation
drip copied to clipboard

IllegalAccessException on multiple invocations

Open jimbru opened this issue 10 years ago • 2 comments

Executing a simple Hello World program fails with IllegalAccessException on subsequent runs.

  1. Create simple HelloWorld.java file:
class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello Drip");
    }
}
  1. Compile it: javac HelloWorld.java.
  2. Run it with Drip: drip -cp . HelloWorld.
  3. Repeat step 3, see exception.

Paste of console output:

ip-10-1-10-16:java jim$ drip -cp . HelloWorld
Hello Drip
ip-10-1-10-16:java jim$ drip -cp . HelloWorld
Exception in thread "main" java.lang.IllegalAccessException: Class org.flatland.drip.Main can not access a member of class HelloWorld with modifiers "public static"
    at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:101)
    at java.lang.reflect.AccessibleObject.slowCheckMemberAccess(AccessibleObject.java:295)
    at java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:287)
    at java.lang.reflect.Method.invoke(Method.java:476)
    at org.flatland.drip.Main.invoke(Main.java:117)
    at org.flatland.drip.Main.start(Main.java:88)
    at org.flatland.drip.Main.main(Main.java:64)

Java v1.8.0_25

jimbru avatar Oct 16 '14 07:10 jimbru

Did you try it using public class HelloWorld { ?

OLFDB avatar Feb 07 '16 11:02 OLFDB

@OLFDB It's been 6 months...but I probably didn't. Can that explain why it works on the first invocation?

jimbru avatar Feb 10 '16 19:02 jimbru