summaryrefslogtreecommitdiff
path: root/libjava/testsuite/libjava.jni/pr29812.java
blob: 4dde744bee37b549b91b063abde18615bd8cd8af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import java.io.File;
import java.net.*;
import java.lang.reflect.Method;

public class pr29812
{
  static {
    System.loadLibrary("pr29812");
  }

  public static native void baseN();

  public static void main(String[] args) throws Throwable
  {
    // Make sure JNI environment is initialized.
    baseN();

    File jar = new File(args[0]);
    URL u = jar.toURL();
    URLClassLoader uc = new URLClassLoader(new URL[] { u });
    Class k = uc.loadClass("pr29812_injar");
    Method m = k.getMethod("doit", (Class[]) null);
    m.invoke(null, (Object[]) null);
  }
}