ninjudd / drip

Fast JVM launching without the hassle of persistent JVMs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IllegalAccessException on multiple invocations

jimbru opened this issue · 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

commented

Did you try it using public class HelloWorld { ?

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