runjags trouble locating JAGS - error "'where' not found" even after setting jagspath <p>Seems that runjags suddenly (after update to version 2.0.3-2) has trouble finding JAGS binary, issuing an error: </p> <pre><code>[1] "Error in system(\"where jags\", intern = TRUE) : 'where' not found\n" attr(,"class") [1] "try-error" attr(,"condition") &lt;simpleError in system("where jags", intern = TRUE): 'where' not found </code></pre> <p>I fixed this by putting this line to my <code>Rprofile</code>:</p> <pre><code>.runjags.options &lt;- list(jagspath = "c:/Program Files/JAGS/JAGS-4.2.0/i386/bin/jags-terminal.exe") </code></pre> <p>This pretty much fixes the problem (although it is not ideal - previous versions of runjags could find the binary automatically).</p> <p>However, when the Rgui (in Windows XP) is launched by opening an .Rdata file, which is associated to it, it stops working:</p> <pre><code>&gt; .runjags.options # it was set in the Rprofile $jagspath [1] "c:/Program Files/JAGS/JAGS-4.2.0/i386/bin/jags-terminal.exe" &gt; require(runjags) Loading required package: runjags Warning message: package ‘runjags’ was built under R version 3.1.3 &gt; runjags.getOption("jagspath") [1] "Error in system(\"where jags\", intern = TRUE) : 'where' not found\n" attr(,"class") [1] "try-error" attr(,"condition") &lt;simpleError in system("where jags", intern = TRUE): 'where' not found </code></pre> <p>Is this a bug? How to fix this?</p> <p>I am currently calling <code>runjags.options(jagspath = "c:/Program Files/JAGS/JAGS-4.2.0/i386/bin/jags-terminal.exe")</code> in my source after <code>require(runjags)</code>, but I would like to avoid this as much as possible!</p>