user4404699 user4404699 - 1 year ago 110
R Question

Trouble installing package "OpenStreetMap" in RStudio

I am trying to install

in RStudio.
I am under
OS 10.11.3
My java version is :
➜ ~ java -version
java version "1.8.0_73"
Java(TM) SE Runtime Environment (build 1.8.0_73-b02)
Java HotSpot(TM) 64-Bit Server VM (build 25.73-b02, mixed mode)

When I install it I have the following message :

Installing package into ‘/Users/anhnguyen/Library/R/3.2/library’
(as ‘lib’ is unspecified)
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 2 2209k 2 49152 0 0 61339 0 0:00:36 --:--:-- 0:00:36 61286 29 2209k 29 658k 0 0 367k 0 0:00:06 0:00:01 0:00:05 367k 95 2209k 95 2114k 0 0 757k 0 0:00:02 0:00:02 --:--:-- 757k100 2209k 100 2209k 0 0 774k 0 0:00:02 0:00:02 --:--:-- 774k
The downloaded binary packages are in /var/folders/qm/gj1n93fd7rg8rgz1ldq19gm80000gn/T//Rtmpuwj9O5/downloaded_packages

Then when loading the library I have :

JavaVM: requested Java version ((null)) not available. Using Java at "" instead.
JavaVM: Failed to load JVM: /bundle/Libraries/libserver.dylib
JavaVM FATAL: Failed to load the jvm library.
Error in .jinit() : JNI_GetCreatedJavaVMs returned -1
Error : .onLoad a échoué dans loadNamespace() pour 'OpenStreetMap', détails :
appel : fun(libname, pkgname)
erreur : Java classes could not be loaded. Most likely because Java is not set up with your R installation.
Here are some trouble shooting tips:
1. Install Java

2. Run
R CMD javareconf
in the terminal. If you are using Mac OS X >= 10.7 you may want to try
R CMD javareconf JAVA_CPPFLAGS=-I/System/Library/Frameworks/JavaVM.framework/Headers
Erreur : le chargement du package ou de l'espace de noms a échoué pour ‘OpenStreetMap’

I have already installed other packages without problem.
I have read that it might missed
and has installed it as well without solving my current problem.

Thank you for your help.

Answer Source

So in the end, in spite of having java already installed I did this:

1) I reinstalled java with this link without removing my already installed java 2) I ran in my terminal R CMD javareconf though my MacOS was >= 10.7

I have to say that months ago I did solve this problem and even though today the same error appeared again.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download