[R-SIG-Mac] Problems with rJava fir R 3.6.1

Manuel Spínola m@p|no|@10 @end|ng |rom gm@||@com
Thu Sep 19 17:53:49 CEST 2019


Hi Thomas,

I have a similar problem and I solved installing the jdk version 11.0.1 (I
guess this is the version that rJava expect that you have installed).  You
need to search in the JDK archive to find this version.  I tried the last
JDK version 11.0.4 and it didn't work.

After that I wrote in the terminal:

R CMD javareconf

And it works for me.

Manuel

El jue., 19 sept. 2019 a las 6:09, Thomas Knox (<knoxy1827 using gmail.com>)
escribió:

> I have recently installed R 3.6.1 on my MacBook running Mac OS Mojave
> 10.14.5 in order to run a custom package called MH1823 (probability of
> detection).  This package requires me to load the following packages from
> CRAN, tcltk, tcltk2, survival and xlsx.
>
>
>
> I have installed survival, xlsx and tlctk2 (i believe tcltk is embedded).
> When I look at Package Manager i see that although the above packages are
> installed they are not loaded.  I can load survival but when I try to load
> “xlsx” i get the following  error message is:
>
>
>
> Error: package or namespace load failed for ‘xlsx’:
>
>  .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.6/Resources/library/rJava/libs/rJava.so':
>
>
> dlopen(/Library/Frameworks/R.framework/Versions/3.6/Resources/library/rJava/libs/rJava.so,
> 6): Library not loaded:
> /Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home/lib/server/libjvm.dylib
>
>   Referenced from:
> /Library/Frameworks/R.framework/Versions/3.6/Resources/library/rJava/libs/rJava.so
>
>   Reason: image not found
>
> starting httpd help server … done
>
>
>
>
>
> there may be a couple of hints in here.
>
>
>
>  .onLoad failed in loadNamespace() for 'rJava', details  suggests the
> problem starts with calling rJava.
>
>
>
> the next line in the error:
>
> error: unable to load shared object
> '/Library/Frameworks/R.framework/Versions/3.6/Resources/library/rJava/libs/rJava.so':
>
> I have checked this path and see no problems, everything seems to stack up
> and I find jJava.so where it is supposed to be.  However in the next line:
>
>  dlopen(/Library/Frameworks/R.framework/Versions/3.6/Resources/library/rJava/libs/rJava.so,
> 6): Library not loaded:
> /Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home/lib/server/libjvm.dylib
>
> I don’t know what the number , 6 after Java.so means but have presumed
> version number and may be why Java8 is not working.  I also note the path
> …. /JavaVirtualMachines/jdk-11.0.1.jdk/ appears as . /JavaVirtualMachines/
> 1.6.0.jdk/
>
> suggesting a different build
>
>
>
> the same occurs when I try to load the local source package MH1823
>
>
>
> When I try to load HM1823 I get the error message:
>
> * installing *source* package ‘mh1823’ ...
>
> ** using staged installation
>
> ** R
>
> ** data
>
> ** inst
>
> ** byte-compile and prepare package for lazy loading
>
> Error: package or namespace load failed for ‘xlsx’:
>
>  .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.6/Resources/library/rJava/libs/rJava.so':
>
>
> dlopen(/Library/Frameworks/R.framework/Versions/3.6/Resources/library/rJava/libs/rJava.so,
> 6): Library not loaded:
> /Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home/lib/server/libjvm.dylib
>
>   Referenced from:
> /Library/Frameworks/R.framework/Versions/3.6/Resources/library/rJava/libs/rJava.so
>
>   Reason: image not found
>
> Error: package ‘xlsx’ could not be loaded
>
> Execution halted
>
> ERROR: lazy loading failed for package ‘mh1823’
>
> * removing
> ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/mh1823’
>
> >
>
>
>
> I find that the error message is substantially the same suggesting rJava
> and/or the version of Java.  I have tried removing Java 8 from my machine
> and installing Java 6 but don’t see any difference.  It is easy to see that
> Java 8 has been removed but not easy to see that 6 is installed properly as
> the path names are still the same.
>
>
>
> When I try to load either tcltk or tcltk2, my instance of R stops
> responding entirely.
>
>
>
> I have also installed Xquartz as I believe this is needed for Mac OS X
>
>
>
> Can anyone provide some advice on what the issue might be?  I have tried
> reading through the FAQ’s but not found anything to point me in the right
> direction to correct the problem.
>
>
>
> Regards,
>
>
>
> Tom Knox
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspinola using una.cr <mspinola using una.ac.cr>
mspinola10 using gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

	[[alternative HTML version deleted]]



More information about the R-SIG-Mac mailing list