[R] Problem with installing "mapview"

David Winsemius dwinsemius at comcast.net
Tue Jan 26 02:11:17 CET 2016


> On Jan 25, 2016, at 4:20 PM, Debasish Pai Mazumder <pai1981 at gmail.com> wrote:
> 
> Hi all,
> 
> I am using Rstudio version 0.99.491. I am trying install "mapview" package.
> install.packages("mapview")
> 
> I receive following error message
> 
> configure: error: Cannot compile a simple JNI program. See config.log for
> details.
> 
> Make sure you have Java Development Kit installed and correctly registered
> in R.
> If in doubt, re-run "R CMD javareconf" as root.

The blog posting noted below recommends instead trying (for Mac users in a Terminal window, although this is a guess based on the directory structure in the error messages):

sudo R CMD javareconf -n

> 
> ERROR: configuration failed for package ‘rJava’
> * removing ‘/Volumes/Users/debasish/Library/R/3.2/library/rJava’
> Warning in install.packages :
>  installation of package ‘rJava’ had non-zero exit status
> ERROR: dependency ‘rJava’ is not available for package ‘OpenStreetMap’
> * removing ‘/Volumes/Users/debasish/Library/R/3.2/library/OpenStreetMap’
> Warning in install.packages :
>  installation of package ‘OpenStreetMap’ had non-zero exit status
> ERROR: dependency ‘OpenStreetMap’ is not available for package ‘mapview’
> * removing ‘/Volumes/Users/debasish/Library/R/3.2/library/mapview’
> Warning in install.packages :
>  installation of package ‘mapview’ had non-zero exit status
> 
> Then I tried install rJava package
> install.packages("rJava")
> 
> I got followings
> 
> configure: error: Cannot compile a simple JNI program. See config.log for
> details.
> 
> Make sure you have Java Development Kit installed and correctly registered
> in R.
> If in doubt, re-run "R CMD javareconf" as root.
> 
> ERROR: configuration failed for package ‘rJava’
> * removing ‘/Volumes/Users/debasish/Library/R/3.2/library/rJava’
> Warning in install.packages :
>  installation of package ‘rJava’ had non-zero exit status
> 
> Please let me know is there any other way to install mapview package

Seems pretty clear that you will need to have a version of Java installed. My memory of struggling through that process was that some packages needed to have a version less recent that the currently distributed version. Whether my memory is relevant to your situation will possibly depend on whether my guess that you are on a Mac with  Mavericks+ OS is correct. (And note you were requested very specifically in the Posting Guide to include more specifics of your setup.)

The package DESCRIPTION file say its support page is here:
http://www.rforge.net/rJava/

I _think_ that this blog post might be useful:
http://www.r-bloggers.com/getting-r-and-java-1-8-to-work-together-on-osx/

Despite following those recommendations the report on version still says : java version "1.8.0_65"

Further caveat: I'm not a regular user of RStudio, so there may be issues I have not encountered. Rstudio also has a support forum.

Nonetheless, installing mapview from source on a ElCapMac using the MacGUI Package Installer with XCode and Command Line tools in the background did just succeed. (It also installed several other r-pkg dependencies, so you definitely should read the package DESCRIPTION.)

--- from description file
Depends: R (>= 2.10), leaflet, methods
Imports: sp, raster, satellite, scales (>= 0.2.5), brew, htmlwidgets,
        htmltools, png, Rcpp (>= 0.11.3), lattice, latticeExtra, rgdal,
        gdalUtils, data.table, rasterVis, OpenStreetMap

> 
> -Debasish
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html


Do read the Posting Guide and do (re?)-read the Mailing List info page where it is explained that configuration questions for specific OSes (Mac and Debian/Ubuntu) might be more appropriate on particular OS-specific lists.


> and provide commented, minimal, self-contained, reproducible code.
-- 
David Winsemius
Alameda, CA, USA



More information about the R-help mailing list