### 24 responses to “Talking R through Java”

1. greetings, I have a problem big problem, when I try to execute those steps, all work fine until the IDE configuration, I explain me better, I had installed Rjava, I had copied JAR requested, I had updated the environment variables in /etc/environment and until there all works configurate correctly, I work in Netbeans but I didn’t know if I had to do any configuration in the IDE. Finally when I run the program, it appear this “cannot find system Renviron”. Really I had tried all the possible things but I couldn’t fix it. Sorry for my english, and I will appreciate any help that you can give to me for understand why is the reason of my problem. Thanks

2. Really, thank you so much for your help, it will be so useful, now I will follow with my project.

3. Greetings,
Now my Java-R connection works, I can make some calculus. But I do not know how I can use R’s libraries like RODBC through Java, I tried with: re.eval("library(RODBC)"), that did not work. Can you help me to use this library? How can I test the library is actually loaded?
Thanks

4. Greetings,

I am trying to use JRI to programming JAve with R. I am testing a simple program but i have a problem with the REngine constructor. The program exit with the value 10, without exception. I have followed the steps before but i cant fix the problem.

Thanks.

5. Is it possible to invoke r functions or embedding r charts inside jasper’s ireport

6. It really help. Thank you so much.

7. hi,
i hv the problem for runing this
what mean Export the variable before starting Netbeans:

 12 usr@srv $export R_HOME=/usr/lib64/R usr@srv$ netbeans

write at where?

actually my task is to write a java programing that will produce few value. Then i need to pass that value to R. then R will do some process eg sum the value with one. last pass it back to java. How can it work???

8. The reply is late. I am trying to investigate the best way to run simulations on my socket server with varying distributions of bytes. It looks like r-java can do it instead of expensive load runners.

Do you know of anyone who is doing it ?I asked the r-help list but they disregard generic questions like this.

9. Dear George,
The post of Using JRI , R with NetBeans in Windows was an excellent guide. I am using Eclipse IDE and trying to call R via a Java program using JRI.
I have gone through your post and tried to replicate the same thing in Eclipse IDE. I am yet to get a successful output out of the java program (TestR.java). Here is what I did:
1. Set R_Home variable => R_HOME = D:\Program Files\R\R-2.14.0
2. Set PATH variable => PATH = D:\Program Files\R\R-2.14.0\bin\x64;(contains R.dll) D:\Program Files\R\R-2.14.0\library\rJava\jri; (containsJRI.dll,JRI.jar,JRIEngine, REngine), D:\Program Files\R\R-2.14.0\library\rJava\jri\x64 (contains JRI.dll)
3. Added -Djava.library.path=D:\Program Files\R\R-2.14.0\library\rJava\jri\ to the VM arguments, and I executed the program and it gave the following error:
“Could not find the main class: Files\R\R-2.14.0\library\rJava\jri\. Program will exit. “

10. Hi,
is there a way to get error messages from R back?

- CODE EXAMPLE:
Rengine rEngine = new Rengine(new String [] {“–vanilla”}, false, null);
rEngine.eval(“library(xts)”);
rEngine.assign(“arrayValue”, DOUBLE DATA);
rEngine.assign(“arrayDates”, DOUBLE DATA);
rEngine.eval(“test = xts(arrayValue, order.by=arrayDates)”);

The last statement not only takes 1 minute to run, it also seems to fail (no test variable is created)

Thank you and best regards!

11. Hi,

I’m trying to do this in DrJava but I believe I’m getting stuck with setting the R_HOME environmental variable in DrJava. Does anybody know how to do this?

Thanks

12. There’s an eclipse plugin that helps set up the R Java environment at http://www.studytrails.com/RJava-Eclipse-Plugin/.

13. This is not working in my windows machine. It throws exception

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