How to run Java (.jar) in R?

Is there any way to run jar jar file in R? I want one of the .jar outputs to be used in R.

+4
source share
3 answers

Java .jarcan only be executed java; so you need a way to run an external command from R. The command will be java, with arguments -jarand your.jar.

As far as I can tell, you need to use the system function , something like strings

javaOutput <- system("/usr/local/bin/java -jar your.jar", intern = TRUE)

(note, I have not tested this, so please run the test)

+3
source

You can use systemto run the operating system command from R.

To run java jar on a well configured system, this should work:

 system("java -jar /path/to/my.jar")

, , , Java , R . Java , R. , Java, .

Java-, , , . "API" Java.

, system, , .

+2

what about running (.js) in R?

0
source

All Articles