java - 64 位环境下 JRI 库的问题

标签 java r 32bit-64bit jri rjava

我正在尝试在 64 位计算机上设置和使用 JRI。我已经安装了带有 64 位 JVM 的 R 2.14.1 和 rJava 0.9-3。我已经成功使用命令

在 R 中安装了 rJava 包

install.packages("rJava")

但是当尝试通过代码访问它时,我收到以下错误,

Cannot find JRI native library!
Please make sure that the JRI native library is in a directory listed in java.library.path.

java.lang.UnsatisfiedLinkError: C:\Users\abc\Documents\R\win-library\2.14\rJava\jri\x64\jri.dll: Can't load AMD 64-bit .dll on a IA 32-bit platform
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1807)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1732)
    at java.lang.Runtime.loadLibrary0(Runtime.java:823)
    at java.lang.System.loadLibrary(System.java:1028)
    at org.rosuda.JRI.Rengine.<clinit>(Rengine.java:19)
    at com.mango.workflow.connector.r.internal.RExec.startR(RExec.java:160)
    at com.mango.workflow.connector.r.internal.RExec.execute(RExec.java:288)
    at com.mango.workflow.connector.r.RExecTest.testPlus(RExecTest.java:68)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:69)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:48)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:292)
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:236)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:134)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:113)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
    at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
    at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:103)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74)

最佳答案

我认为您没有使用 64 位 JVM 启动应用程序:

Can't load AMD 64-bit .dll on a IA 32-bit platform

或者您的系统根本不是 64 位。

关于java - 64 位环境下 JRI 库的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9376396/

相关文章:

java - 连接到本地公共(public) mysql 服务器

r - R 中具有堆栈条形图和簇条形图的水平条形图

com - 在 64 位组件中注册 32 位 COM 类

c - 为什么 fseeko() 会失败并显示 EINVAL?

c - 为什么 C 编译器将 long 指定为 32 位,将 long long 指定为 64 位?

java - com.microsoft.sqlserver.jdbc.SQLServerException : This operation is not supported

java - 当在selenium中同时打开多个页面窗口时,如何导航到特定选项卡?

r - 如何在 Shiny 应用程序的 selectModUI 中更新传单 map ?

r - 如何查看功能的源代码?

java - 如何找到 Collection 类型?