jaotc无法从java.base中找到类

时间:2018-01-30 15:26:14

标签: java linux java-9 aot jaotc

如何设置/运行jaotc以便找到标准的JDK类?
使用JDK 9 expiremental AOT编译器预构建一些库,许多因类似原因而失败。例如

jaotc --compile-for-tiered --info --output ../aoclib/postgresql-9.4.1208.so --jar ./postgresql-9.4.1208.jar

重新开始

Compiling ../aoclib/postgresql-9.4.1208...
 (85 ms)
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/jna/win32/StdCallLibrary
    at java.base/java.lang.ClassLoader.defineClass1(Native Method)
    at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1007)
    at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
    at java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:545)
    at java.base/java.net.URLClassLoader.access$100(URLClassLoader.java:83)
    at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:453)
    at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:447)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:446)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:563)
    at java.base/java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:890)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496)
    at jdk.aot/jdk.tools.jaotc.collect.ClassSearch.loadClass(ClassSearch.java:55)
    at jdk.aot/jdk.tools.jaotc.collect.ClassSearch.lambda$search$0(ClassSearch.java:47)
    at jdk.aot/jdk.tools.jaotc.collect.jar.JarFileSource.eachClass(JarFileSource.java:47)
    at jdk.aot/jdk.tools.jaotc.collect.ClassSearch.search(ClassSearch.java:47)
    at jdk.aot/jdk.tools.jaotc.Main.run(Main.java:369)
    at jdk.aot/jdk.tools.jaotc.Main.run(Main.java:306)
    at jdk.aot/jdk.tools.jaotc.Main.main(Main.java:284)
Caused by: java.lang.ClassNotFoundException: com.sun.jna.win32.StdCallLibrary
    at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:466)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:563)
    at java.base/java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:890)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496)
    ... 19 more

0 个答案:

没有答案