代码之家  ›  专栏  ›  技术社区  ›  Tim unnamed eng

Java11中的JNI是否与Java8不向后兼容?

  •  1
  • Tim unnamed eng  · 技术社区  · 4 年前

    When I am installing a R package rJava with OpenJDK 11 ,这是错误

    checking whether Java run-time works... yes
    checking whether -Xrs is supported... yes
    checking whether -Xrs will be used... yes
    checking whether JVM will be loaded dynamically... no
    checking whether JNI programs can be compiled... yes
    checking whether JNI programs run... configure: error: Unable to run a simple JNI program. Make sure you have configured R with Java support (see R documentation) and check config.log for failure reason.
    Warning in system(cmd) : error in running command
    ERROR: configuration failed for package ‘rJava’
    

    rJava公司 可与OpenJDK 8一起安装。

    为什么不同?

    Java11中的JNI是否与Java8不向后兼容?

    谢谢。

    0 回复  |  直到 4 年前
        1
  •  2
  •   user2543253    4 年前

    rJava使用调用接口,需要Java的共享库

    在Linux中,它们是

    • 在里面 lib/i386 lib/amd64 对于Java 8( libjvm.so lib/<arch>/server )
    • 在里面 lib 对于Java 11( libjvm.so文件 lib/server

    一旦一个进程在新的位置找到这些库,Java11就可以向后兼容。