无法在NetLogo中使用R扩展名 [英] Cannot make R-extension work in NetLogo

查看:111
本文介绍了无法在NetLogo中使用R扩展名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我意识到这并不是一个真正的编程问题,但是我希望这里一位经验丰富的NetLogo员工可以看到我做错了,特别是因为你们中的许多人都在Java中工作而我却没有.

I realise this is not really a programming question, but I am hoping that one of the very experienced NetLogo people here can see what I am doing wrong, especially as many of you work in Java and I don't.

我正在尝试连接R扩展名,以便可以使用R库执行一些棘手的网络工作.我正在使用Windows7.详细的安装说明描述了必须设置的三个系统变量.我这样做了,并从命令提示符中回显了它们,R_HOME和JRI_HOME连接到似乎合适的目录,并且我的PATH包含R bin.

I am trying to connect up the R-extension so I can use R libraries to do some tricky network stuff. I am using Windows 7. The detailed installation instructions describe three system variables that must be set. I have done so and echoing them from the command prompt, R_HOME and JRI_HOME connect to what appear to be the appropriate directories and my PATH includes the R bin.

安装说明的第4步从命令行打开R终端,并且工作正常.类似地,从该终端内加载rJava库(即步骤6,输入library(rJava))将返回适当的消息.对Java版本的检查(第9步)将返回适当的64位响应,与文档中的响应完全相同,只是我的vm版本是最新的.

Step 4 of the installation instructions opens an R terminal from command line and that works fine. Similarly, loading the rJava library from within that terminal (that is step 6, entering library(rJava)) returns the appropriate message. The check on java versions (step 9) returns the appropriate 64 bit responses, exactly the same as in the documentation except that my vm version is more recent.

一起测试所有内容(步骤12)将打开NetLogo,然后键入extensions [r],但勾选标记会立即将其关闭.根据文档,这是R_HOME和PATH的错误,但我看不到它.在命令行中,我得到一个错误Cannot find JRI native library! Please make sure that the JRI native library is in a directory listed in java.library.path,随后是许多Java错误.

Testing it all together (step 12) opens NetLogo and I type extensions [r] but the check tick closes it immediately. According to the documentation, this is an error with R_HOME and PATH, but I can't see it. In the command line, I get an error Cannot find JRI native library! Please make sure that the JRI native library is in a directory listed in java.library.path followed by many java errors.

是否有一个我忘记设置的环境变量?即使在文档中没有描述,我是否真的需要在java.library.path中添加一些内容?

Is there an environment variable I forgot to set? Do I need to actually add something to the java.library.path even though that's not described in the documentation?

更新

在进一步研究中,r扩展附带了一个名为rsystemcheck的扩展.安装该文件[请注意其他有此问题的人,只需将文件夹移到extensions文件夹中],看来我的计算机已安装(至少)两个Java版本.这并不奇怪,因为Java更新过程并未真正清理干净,并且许多程序会安装运行时的其他版本.

On further investigation, there is an extension called rsystemcheck that is shipped with the r extension. Installing that [note for others who have this problem, simply move the folder into the extensions folder], it appears that my computer has (at least) two versions of Java installed. This is not terribly surprising as the Java update process doesn't really clean up and lots of programs install additional versions of the runtime.

检查Java"工具报告我已经安装了v1.8.0_51和v1.6.0_45,并且如果其中一个是32位而另一个是64位,则R扩展将无法工作.

The 'Check java' tool reports that I have v1.8.0_51 and v1.6.0_45 installed and that if one is 32bit and the other is 64bit then the R extension won't work.

在我的文件系统中-v1.8.0_51肯定是32位的.我还安装了v1.7.0 64位(新版本!).我无法直接找到v1.6.0_45,但是我认为这是NetLogo安装的jre文件夹中的版本.

Ratting around in my file system - v1.8.0_51 is definitely 32bit. I also have v1.7.0 64bit (a new one!) installed. I can't find v1.6.0_45 directly, but I think this is the version that is in the jre folder of the NetLogo installation.

此外,尝试在没有VM的情况下安装NetLogo并指向我的JRE不起作用,因为NetLogo要求JRE为32位.此外,由于我使用64位R,因此无法卸载Java并替换为32位版本.

Furthermore, trying to install NetLogo without the VM and pointing to my JRE does not work because NetLogo requires the JRE to be 32bit. Further, uninstalling java and replacing with the 32bit version does not work because I use 64bit R.

推荐答案

好的,解决了(如果有些不满意).我将其保留在这里,是因为我想其他使用Windows的人希望R和NetLogo能够相互交谈.

okay, solved (if somewhat unsatisfactorily). I am leaving this here because I imagine other people using Windows want R and NetLogo to talk to each other.

问题是NetLogo需要32位Java.我不知道R扩展的开发人员如何获得64位R的屏幕截图,但是您真正需要做的是使用32位R.

The problem is that NetLogo requires 32 bit Java. I have no idea how the developers of the R extension(s) got screenshots with 64bit R, but what you really need to do is use 32 bit R.

(1) uninstall 64bit java and instead install 32bit java

(2) add the 32bit R installation

(3) leave the environment variable %R_HOME% as in instructions

(4) add %R_HOME%\bin\i386 to Path

重要的是步骤(4),它使R扩展找到R的32位安装.R安装目录有两个bin子目录,一个用于64位(x64),一个用于32位(i386).路径需要找到32位版本.

The important bit is step (4), which makes the R extension find the 32 bit installation of R. The R installation directory has two bin subdirectories, one for 64bit (x64) and one for 32bit (i386). The Path needs to find the 32 bit version.

步骤(1)可能是可选的-我只是没有必要的Java知识才能弄清楚如何处理32位和64位版本的Java.

Step (1) may be optional - I simply don't have the java understanding necessary to work out how to deal with 32 and 64 bit versions of java.

这篇关于无法在NetLogo中使用R扩展名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆