[R] Identifying presence of Java

Abby Spurdle @purd|e@@ @end|ng |rom gm@||@com
Sat Nov 9 22:24:34 CET 2019


> I would like to capture this output in R using the system command, then search for “No Java runtime installed” )or the correponding text in Windows).
>
> I execute something like:
>         CAPTURE <- system("Java -version", intern=TRUE, ignore.stderr=FALSE, ignore.stdout=FALSE)
> (with various permutations of TRUE/FALSE for the options) but I cannot capture what is displayed on the console.

That's fascinating...
I'm offsite, I'll try it tomorrow...

Two questions:
(1) What is the value of CAPTURE (or does it hang)?
(2) Can you run other java commands ("java MyClass", "javac MyClass.java", etc)?

Another thing, did you try Duncan's suggestion?
If that doesn't work, another possibility is to pipe the output, to a
command line app that echos the text.



More information about the R-help mailing list