Java to R interface

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Java to R interface

Madhura-2
I am developing an application that uses Eclipse framework on Windows.
I have to call R from Java.  I downloaded rJava package and installed
it.  I set the classpath in the Run Dialog in Eclipse to the directory
where the JRI.jar is.  I set the Path environmental variable to the
directory where R.dll and jri.dll are.  Yet when I run the rtest
example (in jri/examples directory), I get the following error.

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: no jri in java.library.path
        at java.lang.ClassLoader.loadLibrary(Unknown Source)
        at java.lang.Runtime.loadLibrary0(Unknown Source)
        at java.lang.System.loadLibrary(Unknown Source)
        at org.rosuda.JRI.Rengine.<clinit>(Rengine.java:9)
        at sample.rtest.main(rtest.java:54)

I think I have put jri.jar in all the places that i need to.  Yet I am
unable to get the program to work.  Any help is much appreciated.

Thanks,
Madhura

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Java to R interface

Dumblauskas, Jerry
Try and make sure that R is in your windows Path variable

I got your message when I first did this, but when I did the about it
then worked...

==============================================================================
Please access the attached hyperlink for an important electronic communications disclaimer:

http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
==============================================================================

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Java to R interface

Madhura-2
The path to R/bin is in the Windows PATH variable.  Yet I get this
error.

On Jun 6, 10:37 am, "Dumblauskas, Jerry" <jerry.dumblaus...@credit-
suisse.com> wrote:

> Try and make sure that R is in your windows Path variable
>
> I got your message when I first did this, but when I did the about it
> then worked...
>
> ===========================================================================­===
> Please access the attached hyperlink for an important electronic communications disclaimer:
>
> http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
> ===========================================================================­===
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing listhttps://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Java to R interface

Dumblauskas, Jerry
In reply to this post by Madhura-2
So the system path is set.
In your props you set the jar (otherwise you will not compile)

But, in your class you run with did you pass as a system call the path
to jri?

In my system I pass it in as such

-Djava.library.path=C:\R\R-2.7.0\library\rJava\jri

If I remove that I get your error....

(in eclispe this is in the arguments tab in the vm section)

Hth



The path to R/bin is in the Windows PATH variable.  Yet I get this
error.

On Jun 6, 10:37 am, "Dumblauskas, Jerry" <jerry.dumblaus... at credit-
suisse.com> wrote:
> Try and make sure that R is in your windows Path variable
>
> I got your message when I first did this, but when I did the about it
> then worked...

==============================================================================
Please access the attached hyperlink for an important electronic communications disclaimer:

http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
==============================================================================

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Java to R interface

peterburzhec
In reply to this post by Madhura-2
I already posted this on another forum
I kept having the same problem. Turns out the issue was - I set my pathwrong.
Make sure you have both, the path to R.dll and jri.dll in your path CORRECTLY, and make sure that you don't put any spaces inbetween values in the path.


madhura wrote
The path to R/bin is in the Windows PATH variable.  Yet I get this
error.

On Jun 6, 10:37 am, "Dumblauskas, Jerry" <jerry.dumblaus...@credit-
suisse.com> wrote:
> Try and make sure that R is in your windows Path variable
>
> I got your message when I first did this, but when I did the about it
> then worked...
>
> ===========================================================================­===
> Please access the attached hyperlink for an important electronic communications disclaimer:
>
> http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
> ===========================================================================­===
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-h...@r-project.org mailing listhttps://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Java to R interface

iammyr
In reply to this post by Madhura-2
I know this is an old thread but, since the issue posted here has not been solved, if someone is still needing help, I suggest to have a loook at http://www.gisos.de/blog/articles/5/jri-and-eclipse-first-steps