Domanda

I've built an R/Java interface in eclipse which works on my machine. I need to transfer it to another machine and I want to have it as an executable jar file.

I have exported the package into an executable jar from eclipse and coupled it in a folder with a simple .bat file I created. The .bat file is as follows:

echo off
java -jar myPackage.jar
pause

On my machine this runs without a problem, however, when I transfer the folder over to another machine the native JRI library cannot be found. I think this is more than likely to do with the environment variables? I had set up the environment variables (Path; R_DOC_DR; R_INCLUDE_DR; R_SHARE_DR) in eclipse per class (probably not the best way to go about it).

I've seen online that you can add/edit environmental variables via the My Computer properties, however, I was wondering if there is any way of including them in the .bat file? I want to be able to give this to someone and for them to simply run the .bat file without any messing around.

Thanks in advance for the help,

Aran

È stato utile?

Soluzione

As far as I understand R is implemented as a native library (DLL on windows). Path to the DLL must be included into MANIFEST.MF (probably it must not be there if DLL is in your current directory.

Anyway, I believe that this DLL is in your current directory when you are working on your machine and cannot be found on other machine. So copy the DLL together with your jar file and it should work.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top