4

I'm trying to set up JRI with Eclipse on a Windows 7 x64 system. I tried it once on my Laptop and it worked. Now on my Desktop it fails although everything of the R, rJava and JRI installation is exactly the same.

I set the JRI and R Paths correctly to: C:\Program Files\R\R-2.15.1\library\rJava\jri;C:\Program Files\R\R-2.15.1\bin\x64

Also I set R_DOC_DIR etc in Eclipse.

Every time I try to run new Rengine(...); it fails without any error or exception. Debugging revealed an: <terminated, exit value: 10>C:\Program Files\Java\jre6\bin\javaw.exe (01.10.2012 18:00:31)

Is there anything I can try? It really bothers me that it works an my Laptop but not on my Workstation despite the same settings everywhere.

Edit: The code that is used to get the Rengine object.

public static Rengine getRengine(){
    if (re == null) createRengine();
    return re;
}

public static void createRengine(){
    if (re!=null) return;
    try{
        if (!Rengine.versionCheck()) {
            System.err.println("** Version mismatch **");
            System.exit(1);
        }  
        String[] arguments = {"--save"};
        re=new Rengine(arguments, false, null);
        if (!re.waitForR()) {
            System.out.println("Cannot load R");
            return;
        }
    }
    catch (Exception e){
        e.printStackTrace();
    }
}

Edit: The last time i tried it i got an errormessage (creating of the REngine worked, this happened never before), R was missing a registryentry. After installing R 2.15.1 again it suddenly worked. Now after a restart it's the same like before. The program crashes at the creation of the REngine.

cokir
  • 41
  • 1
  • 4

2 Answers2

0

I was having the exact same problem. It turns out I had unchecked the box that asks to make a registry entry with the R version number. Once I let the installer run with that box checked, it seemed to work.

I would make sure your regedit looks like this: Screencap of regedit

Next up: getting this working in a portable way...

J. Dimeo
  • 829
  • 8
  • 10
0

I am using R 3.2.2 and eclipse Mars on Windows 10 x64.

I faced the described issue today and tried around a bit. Finally, I found the root cause in the build path. Please check whether the following conditions are fulfilled:

1.) The following Java libraries from the JIRI folder on your hard disk shall be included as (user) libraries:

  • JIRI.jar
  • REngine.jar
  • JRIEngine.jar

2.) The native library jiri.dll is located in the subfolder "i386" for x86, whereas for x64 it is available in the subfolder "x64". The relevant one shall be added as separate native library location to the Java Build Path of the eclipse project. Otherwise, the file may not be considered as it is not located in the main JIRI folder.

Best regards

Philipp

PWillms
  • 211
  • 1
  • 3
  • 10