.jengine() not working in Java, but in R

130 Views Asked by At

I took over an old project from an other person. Currently I'm trying to get this project to work.

Already in the beginning I get an Exception in:

R.parseAndEval(".jengine()");

It throws a REngineEvalExcpetion: error during evaluation.

If I use R in the R-Console, I needed to add a parameter .jengine(start=TRUE) to get the command .jengine() working. So I changed this line in Java accordingly, but I still get the same Exception.

I did a tutorial with R without calling .jengine() and using Rengine instead of REngine and at least somehow it worked and I could call R commands within Java.

I'm currently using R 3.3.3 and Java 1.8. I also don't know which versions have been used previously.

1

There are 1 best solutions below

0
Jupiter On

"error during evaluation" just means that the R thread that is running the R script failed to run that command. But everything in the Java application is working properly. Is R that is failing. R has to have the rJava library in order to run .jengine:

library(rJava)

.jinit(".")

.jengine(TRUE)