1
votes

when trying to install qdap or rJava, it's always returning image not found error

library(rJava) Error: package or namespace load failed for 'rJava': .onLoad failed in loadNamespace() for 'rJava', details: call: dyn.load(file, DLLpath = DLLpath, ...) error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/rJava.so': dlopen(/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/rJava.so, 6): Library not loaded: @rpath/libjvm.dylib Referenced from: /Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/rJava.so Reason: image not found Blockquote

I followed every instruction on this earlier thread, still doesn't work, same error msg.

R version 3.4.0 (2017-04-21) Platform: x86_64-apple-darwin15.6.0 (64-bit) Running under: OS X El Capitan 10.11.6

Matrix products: default BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib

4
Hello. on which operating system are you working on? Can you give more details please?DJJ
hi, i'm on mac which detailed info updated abovesantoku
I guess theres a problem with the installation itself. can you do install.packages("rjava") and check if it was correclty installed?DJJ
fail to set default locale on installation. Reason: image not found on loading library. i had it installed before, but recently upgrade r so lost all the packagessantoku
I guess you have to change your question to installation of rjava does not work. Provide as many detail as you can so that help may come your way.DJJ

4 Answers

0
votes

Uninstall all versions of Java available in your system. And freshly download the 64bit version of Java. Then install "rJava". This would probably resolve this issue. It worked for me.

0
votes

This could help:

Sys.setenv(JAVA_HOME="C:/Program Files/Java/jre1.8.0_112")

Change to your path to Java.

0
votes

It might be worth to look here:

http://www.owsiak.org/?p=3671

I was struggling with R, rJava and Java for some time (macOS) and eventually I have figured out how to make it work quite smooth.

There are few things you have to pay attention to:

  • whether you use Oracle's Java or Apple's one
  • whether you have JNI enabled inside JDK
  • whether R properly finds your JDK installation

Give it a try and see whether my steps will help you with this one.

0
votes

For the one having issues in relation to rJava or qdap installation, many of the fixes described in forums did not work for me. However, the following was successful:

https://github.com/MTFA/CohortEx/wiki/Run-rJava-with-RStudio-under-OSX-10.10,-10.11-(El-Capitan)-or-10.12-(Sierra)

I just changed for the latest version of r. Once rJava was correctly installed, qdap was installed without any problem.