[R] Problem when trying to run Java in R:
dwinsemius at comcast.net
Mon Oct 23 04:17:03 CEST 2017
> On Oct 21, 2017, at 4:35 AM, Morkus via R-help <r-help at r-project.org> wrote:
> Hello All,
> Although running Java from R used to work, for some mysterious reason, it's stopped.
> Today when I tried to load a basic JDBC driver (or the sample .jinit()) code, I got:
> - 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.
> I saw postings on StackOverflow about this issue, but none of the suggested fixes helped.
> I'm on Mac OS 10.13.
> My JAVA_HOME is: /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home
> java -version
> java version "1.8.0_144"
I am not sure why but I do notice that currently: Java Recommended Version 8 Update 151
AND this quoted warning is on the current download page ..
macOS Sierra 10.12 users: A few issues have been reported on Sierra. See FAQ for more information.
Others have reported success with this at the Terminal command line:
sudo R CMD javareconf
#AND then .... at the R command line:
> Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
> Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)
> I'm using R: 3.3.3
> Here is sample code that also throws this same error:
> .jinit() # this starts the JVM
> s <- .jnew("java/lang/String", "Hello World!")
I don't get any error running:
R version 3.4.2 Patched (2017-10-04 r73465)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: OS X El Capitan 10.11.6
Matrix products: default
attached base packages:
 grDevices utils datasets graphics stats methods base
other attached packages:
 rJava_0.9-8 dplyr_0.7.2 gmodels_2.16.2 Matrix_1.2-11 xgboost_0.6-4
 rms_5.1-1 SparseM_1.77 Hmisc_4.0-3 ggplot2_2.2.1 Formula_1.2-1
 survival_2.41-3 sos_2.0-0 brew_1.0-6 lattice_0.20-35
loaded via a namespace (and not attached):
 Rcpp_0.12.11 mvtnorm_1.0-6 gtools_3.5.0 visNetwork_1.0.3
 zoo_1.8-0 assertthat_0.2.0 digest_0.6.12 R6_2.2.2
 plyr_1.8.4 backports_1.1.0 acepack_1.4.1 MatrixModels_0.4-1
 rlang_0.1.2 lazyeval_0.2.0 mxnet_0.10.1 multcomp_1.4-6
 gdata_2.17.0 rstudioapi_0.6 data.table_1.10.4 rpart_4.1-11
 gamlss.data_5.0-0 checkmate_1.8.3 DiagrammeR_0.9.0 splines_3.4.2
 stringr_1.2.0 foreign_0.8-69 htmlwidgets_0.8 igraph_1.0.1
 munsell_0.4.3 compiler_3.4.2 influenceR_0.1.0 rgexf_0.15.3
 pkgconfig_2.0.1 gamlss_5.0-2 base64enc_0.1-3 gamlss.dist_5.0-0
 htmltools_0.3.6 nnet_7.3-12 tibble_1.3.1 gridExtra_2.2.1
 htmlTable_1.9 codetools_0.2-15 XML_3.98-1.7 viridisLite_0.2.0
 MASS_7.3-47 grid_3.4.2 nlme_3.1-131 polspline_1.1.12
 jsonlite_1.5 gtable_0.2.0 magrittr_1.5 scales_0.4.1
 stringi_1.1.5 viridis_0.4.0 bindrcpp_0.2 latticeExtra_0.6-28
 sandwich_2.3-4 TH.data_1.0-8 RColorBrewer_1.1-2 tools_3.4.2
 glue_1.1.1 Rook_1.1-1 parallel_3.4.2 colorspace_1.3-2
 cluster_2.0.6 knitr_1.15.1 bindr_0.1 quantreg_5.33
Running this produces:
> (this is the "hello world" equivalent from the rJava site)
> I also tried to use Java 7 (rev. 51), which used to work, but that still fails.
> Also tried a fresh install of R/RStudio on another machine with the same results (same Java version, etc., however).
> I suspect Java itself is working fine since JDBC code from Java programs has no issues.
> Not sure why loading Java in R stopped working, but would appreciate any suggestions.
> Thanks very much,
> Sent from [ProtonMail](https://protonmail.com), Swiss-based encrypted email.
> [[alternative HTML version deleted]]
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
Alameda, CA, USA
'Any technology distinguishable from magic is insufficiently advanced.' -Gehm's Corollary to Clarke's Third Law
More information about the R-help