0

I was trying to install a package in R using the following command line,

/R-3.2.1/bin/R CMD INSTALL /CNVPanelizer_0.99.10.tar.gz

But it throws me rJava error as follows,

Error : .onLoad failed in loadNamespace() for 'rJava', details:
  call: dyn.load(file, DLLpath = DLLpath, ...)

and so I tried the solution from [stackover][1] ..

But it didnt help me and still the issue perexists

Any solutions is greatly appreciated..my java version is

java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
Community
  • 1
  • 1
ARJ
  • 2,021
  • 4
  • 27
  • 52
  • I had the same trouble a few days ago. Took me some time to resolve it, and I don't remember what I did exactly. In a Linux console, what is the output of `echo $JAVA_HOME` and if it is defined: is this directory included in the output of `echo $PATH`? – RHertel Sep 25 '15 at 12:52
  • Yes the output has the path of JAVA /home/user/Tools/jdk1.8.0_60 the problem is with R SHELla nd I didnt trz with Rstudio – ARJ Sep 25 '15 at 13:45
  • Alright. That narrows down the problem. If it doesn't work in an R shell it won't work in RStudio. I think the $JAVA_HOME output looks strange; I would have expected something like `/usr/lib/jvm/java-8-oracle`. I assume that you have installed Oracle Java recently and that you're working on a Linux system; is that correct? – RHertel Sep 25 '15 at 14:02
  • Maybe [this](http://askubuntu.com/questions/159575/how-do-i-make-java-default-to-a-manually-coninstalled-jre-jdk) helps. In any case, I would suggest that you make sure that your `$PATH` environment variable contains `/home/user/Tools/jdk1.8.0_60/bin/`. – RHertel Sep 25 '15 at 14:09
  • I take it CNVPanelizer depends on rJava. I had the same problem when I was just trying to install rJava, and eventually solved it by installing rJava as root, from source (as well as fiddling with R's java configuration, which may or may not have helped). All steps I took are listed in [this answer](http://stackoverflow.com/questions/26948777/how-can-i-make-rjava-use-the-newer-version-of-java-on-osx/32544358#32544358). – Lizzie Silver Sep 26 '15 at 02:54

1 Answers1

0

Finally this issue is solved by a little bit of change in java version from java 8 to java 7

which java
jdk1.7.0_79/bin/java

and then I created a file /etc/ld.so.conf.d/java.conf with following entries in it (as super user),

/home/user/jdk1.7.0_79/jre/lib/amd64/
/home/user/jdk1.7.0_79/jre/lib/amd64/server

and then run,

sudo ldconfig

and restarted R again and it solved the issue

ARJ
  • 2,021
  • 4
  • 27
  • 52