问题
I'd apreciate your help: i'm trying to run XLconnect but I receive this error message:
> library("XLConnect", lib.loc="C:/Users/1144143929/Documents/R/win-library/2.15")
Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: JAVA_HOME cannot be determined from the Registry
Error: package/namespace load failed for ‘XLConnect’
回答1:
Another point to check is that if your version of R is 32 byte, so must your Java version. Or, 64 byte must match 64 byte.
Second, I ended up adding to my PATH (I am on Windows 8) the location of the jv.dll file that XLConnect needs (I think that was the name of the file). I found the PATH through Control Panel and System Environment (and maybe more).
Third, the Java site will verify that you have Java installed.
Fourth, with the matching architecture and the PATH pointing to the needed .dll file, I rebooted and it all worked.
Good luck.
回答2:
Had the exact same problem. We run 64-bit Windows with 64-bit R. However, our Office and Java are both 32-bit for whatever reason.
Solution: Run the code in 32-bit R.
回答3:
Answer in link resolved my issue.
Before resolution, I tried by adding JAVA_HOME to windows environments. It resolved this error but created another issue. The solution in above link resolves this issue without creating additional issues.
来源:https://stackoverflow.com/questions/21711369/java-home-cannot-be-determined-error-with-xlconnect