java - Error installing R package -
edit:1 have seen using rjava package on win7 64 bit r
i have windows 7 64-bit machine r 3.1.0, java 7u67 64-bit installed. (note: not allowed update r)
java_home set c:\program files\java\jre7
and path includes
c:\program files\java\jre7\bin , c:\program files\java\jre7\server (the last entry jvm.dll file)
from r prompt can see rstudio using 64-bit r
r version 3.1.0 (2014-04-10) -- "spring dance" copyright (c) 2014 r foundation statistical computing platform: x86_64-w64-mingw32/x64 (64-bit) > .machine$sizeof.pointer [1] 8
i can load rjava library fine
> options(java.home="c:\\program files\\java\\jre7\\") > library(rjava) warning message: package ‘rjava’ built under r version 3.1.1
but when try install install bigr package on machine , getting following error message
> install.packages("c:/local/bigr-1.0.tar.gz", repos = null, type = "source") installing package ‘c:/users/alex/documents/r/win-library/3.1’ (as ‘lib’ unspecified) * installing *source* package 'bigr' ... ** r ** inst ** preparing package lazy loading warning: package 'rjava' built under r version 3.1.1 error : .onload failed in loadnamespace() 'rjava', details: call: indl(x, as.logical(local), as.logical(now), ...) error: unable load shared object 'c:/program files/r/r-3.1.0/library/rjava/libs/x64/rjava.dll': loadlibrary failure: specified module not found. error : package 'rjava' not loaded error: lazy loading failed package 'bigr' * removing 'c:/users/alex/documents/r/win-library/3.1/bigr' warning in install.packages : running command '"c:/progra~1/r/r-31~1.0/bin/x64/r" cmd install -l "c:\users\alex\documents\r\win-library\3.1" "c:/local/bigr-1.0.tar.gz"' had status 1 warning in install.packages : installation of package ‘c:/local/bigr-1.0.tar.gz’ had non-zero exit status
any solve problem appreciated..
i had same problem running library(rjava) on r 3.1.1 / rstudio 0.98.1073 on 64-bit windows 8.1 , 64-bit windows 7.
temporary solution set java_home
environment variable in r/rstudio console @ start of each session:
in rstudio console on windows 7 64-bit latest java runtime installed:
sys.setenv(java_home='c:\\program files\\java\\jre7\\')
in rstudio console on windows 8.1 64-bit latest java sdk installed:
sys.setenv(java_home='c:\\program files\\java\\jdk1.8.0_20\\jre\\')
permanent solution requires adding new window's envionment variable appropriate java runtime folder:
add variable java_home
equal c:\program files\java\jre7\
add variable java_home
equal c:\program files\java\jdk1.8.0_20\jre\
i ran problem xlsx
, xlconnect
packages --- seem have missed notice these require java runtime installed , java_home
environment variable set them work properly.
r newbie --- charles.
ps note when setting environment variable java_home in windows, path jre or jre7 not enclosed in single or double quotes , not require \ replaced \\ done when setting these in r/rstudio console window.
Comments
Post a Comment