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.
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.
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.
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.
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?
UPDATE
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.
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.
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.
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.