How to run .jar executable in R script?

I am working on a relatively large data analysis project in which the R script I wrote is the main executable file, invoking all other bits of code. I cannot figure out how to call the .jar executable from my R script, however, and I have not seen this question being posted elsewhere ... is this an opportunity?

+6
source share
2 answers

You can use rJava to instantiate your java object. Then you call its methods.

 library(rJava) .jinit(PATH_TO_YOUR_JAR) # this starts the JVM jobject <- .jnew("yourJavaClass") ## call the constructor .jcall(jobject ,"I",method="YOUR_METHOD") ## call a method 
+6
source

You tried

 system("path/to/file.jar") 
+3
source

Source: https://habr.com/ru/post/959062/


All Articles