[R] Identifying presence of Java

Dirk Eddelbuettel edd @end|ng |rom deb|@n@org
Sat Nov 9 18:35:27 CET 2019


Dennis,

R does that for you already as it needs to know it for rJava too.

On my (Linux) box:

  edd using rob:~$ R CMD config JAVA
  /usr/lib/jvm/default-java/bin/java
  edd using rob:~$ R CMD config JAVA_HOME
  /usr/lib/jvm/default-java
  edd using rob:~$ 

You could also do the equivalent of `which` or `type -p` from R:

  R> Sys.which("javac")
             javac 
  "/usr/bin/javac" 
  R> Sys.which("javacdoesnotexist")
  javacdoesnotexist 
               "" 
  R> 

Hope this helps, Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | edd using debian.org



More information about the R-help mailing list