[R] calling r from java

Eduard Drenth edrenth @end|ng |rom |ry@ke-@k@demy@n|
Mon Nov 30 08:18:46 CET 2020


First attempts to use jri on ubuntu 20.04 stranded.

Steps I followed:

1) download rJava from https://www.rforge.net/rJava/files/
2) create a symlink /usr/lib/libjvm.so to /usr/lib/jvm/java-8-openjdk-
amd64/jre/lib/amd64/server/libjvm.so
3) configure and make jri
4) create a symlink /usr/lib/libjri.so
5) put the built JRI.jar in local maven repo
6) include a dependency to the jar
7) create and run a hello world test for Rengine

The test fails because com.misc.Unsafe.prefetchRead isn't found. As I
understand depending on com.misc.Unsafe.* is a risk.

I will not follow this route any further for now, though I still think
having jri available would be great. Steps to get there are I think:

1) remove com.misc.Unsafe usage from the solution
2) make libjri available in repositories (apt, yum, other)
3) make JRI.jar available in maven central

Bye, Eduard

-----Original Message-----
From: Eduard Drenth <edrenth using fryske-akademy.nl>
To: spurdle.a using gmail.com <spurdle.a using gmail.com>
Cc: r-help using r-project.org <r-help using r-project.org>
Subject: Re: [R] calling r from java
Date: Sat, 28 Nov 2020 11:57:49 +0000

Thanks all, I'll go for https://www.rforge.net/JRI/ and the librariesin
maven https://search.maven.org/search?q=jri

The maven library is build from  here 
https://www.rforge.net/rJava/files/ back in 2017.
After this no new libs are published to maven.
It would be nice (understatement) if publishing new rJava components
tomaven becomes a regular part of R deveopment processes.
This would promote R use from Java which I think is good.
And of course I can help.
Bye, Eduard
-----Original Message-----From: Abby Spurdle <spurdle.a using gmail.com>To:
Eduard Drenth <edrenth using fryske-akademy.nl>Cc: r-help using r-project.org <
r-help using r-project.org>Subject: Re: [R] calling r from javaDate: Sat, 28
Nov 2020 15:55:36 +1300
Hi Eduard,
> Now I developed a service that executes Rscript
> (UsingProcessBuilder),sends text to stdin of the process and reads
> fromstdout of theprocess.

This doesn't answer your question, but may be relevant.I have a java-
based application that works on a similar principle.(The code
ishorrendously bad and most of it should be thrown away).I'm planning
to write a terminal emulator, in the nearfuture.(Currently, second
place on my top-level todo list).The primary objective is to build
object-oriented and messagepassingAPIs on top of the core terminal
emulation system, with at leastsomecross platform functionality.Noting
that, in my opinion, the cross-platform aspect is moreimportant for R,
than in many other IPC topics.Hence, I'm interested in hearing
"wishlist" items for such
APIs.______________________________________________R-help using r-project.org 
mailing list -- To UNSUBSCRIBE and more, see
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.
-- 
Eduard Drenth, Software Architekt

edrenth using fryske-akademy.nl

Doelestrjitte 8
8911 DX  Ljouwert
+31 58 234 30 47
+31 62 094 34 28 (privé)

skype: eduarddrenth
https://github.com/eduarddrenth
frisian.eu
gpg: https://pgp.surfnet.nl/pks/lookup?search=eduarddrenth


Op freed bin ik thús/wurkje ik minder





-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20201130/52b422b6/attachment.sig>


More information about the R-help mailing list