[R] Identifying presence of Java

Abby Spurdle @purd|e@@ @end|ng |rom gm@||@com
Sun Nov 10 20:49:19 CET 2019


> These seem to work for me:
>   system("Java -version 2>&1", intern = TRUE)
>
>   system2("Java","-version", stdout = TRUE, stderr = TRUE)
>

Hi Dennis

I tried your example and Duncan's examples.
In your example, I get zero.
The second of Duncan's examples worked for me, but not the first.

I've got a suspicion that java is writing in unicode, but R is
expecting another format, however, I could be completely wrong on
that.

The following also worked for me:
CAPTURE = shell ("Java -version 2>&1", intern=TRUE)

Abs



More information about the R-help mailing list