Spencer,

1) you don't seem to have working tools on your Mac (check config.log)
2) on Windows you don't have JDK installed

I would strongly recommend using the CRAN binaries of rJava 0.9-12 unless you 
know what you're doing and have all the tools (for Mac use 
https://mac.R-project.org as mirror since there was a hiccup with macOS sync 
across mirrors).

Cheers,
Simon




> On 29/03/2020, at 4:29 PM, Spencer Graves <spencer.gra...@prodsyse.com> wrote:
> 
> Hi, Simon et al.:
> 
> 
>       My attempts to install rJava 0.9-12 from source failed under both macOS 
> 10.15.4 and Windows 10.
> 
> 
>       Below please find what I got just now trying "update.packages()" and 
> selecting "install from sources" on both computers followed by 
> "sessionInfo()" in each case.
> 
> 
>       Thanks for your help.
>       Spencer Graves
> 
> 
>  update.packages()
> rJava :
>  Version 0.9-11 installed in 
> /Library/Frameworks/R.framework/Versions/3.6/Resources/library
>  Version 0.9-12 available at https://cran.rstudio.com
> Update? (Yes/no/cancel) y
> sf :
>  Version 0.8-1 installed in 
> /Library/Frameworks/R.framework/Versions/3.6/Resources/library
>  Version 0.9-0 available at https://cran.rstudio.com
> Update? (Yes/no/cancel) n
> XLConnect :
>  Version 0.2-15 installed in 
> /Library/Frameworks/R.framework/Versions/3.6/Resources/library
>  Version 1.0.1 available at https://cran.rstudio.com
> Update? (Yes/no/cancel) n
> 
>   There is a binary version available but the
>   source version is later:
>       binary source needs_compilation
> rJava 0.9-11 0.9-12              TRUE
> 
> Do you want to install from sources the package which needs compilation? 
> (Yes/no/cancel) y
> installing the source package ‘rJava’
> 
> trying URL 'https://cran.rstudio.com/src/contrib/rJava_0.9-12.tar.gz'
> Content type 'application/x-gzip' length 1103629 bytes (1.1 MB)
> ==================================================
> downloaded 1.1 MB
> 
> * installing *source* package ‘rJava’ ...
> ** package ‘rJava’ successfully unpacked and MD5 sums checked
> ** using staged installation
> checking for gcc... clang
> checking whether the C compiler works... yes
> checking for C compiler default output file name... a.out
> checking for suffix of executables...
> checking whether we are cross compiling... configure: error: in 
> `/private/var/folders/mh/mrm_14nx19g13lsnj9zmvwjr0000gn/T/Rtmpm3rVc5/R.INSTALL5d09696e941d/rJava':
> configure: error: cannot run C compiled programs.
> If you meant to cross compile, use `--host'.
> See `config.log' for more details
> ERROR: configuration failed for package ‘rJava’
> * removing 
> ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/rJava’
> * restoring previous 
> ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/rJava’
> 
> The downloaded source packages are in
> ‘/private/var/folders/mh/mrm_14nx19g13lsnj9zmvwjr0000gn/T/RtmpbxyWRI/downloaded_packages’
> Warning message:
> In install.packages(update[instlib == l, "Package"], l, repos = repos,  :
>   installation of package ‘rJava’ had non-zero exit status
> > sessionInfo()
> R version 3.6.3 (2020-02-29)
> Platform: x86_64-apple-darwin15.6.0 (64-bit)
> Running under: macOS Catalina 10.15.4
> 
> 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.6/Resources/lib/libRlapack.dylib
> 
> locale:
> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
> 
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets
> [6] methods   base
> 
> loaded via a namespace (and not attached):
> [1] compiler_3.6.3 tools_3.6.3
> 
> 
> 
> > update.packages()
> rJava :
>  Version 0.9-11 installed in C:/Program Files/R/R-3.6.3/library
>  Version 0.9-12 available at https://cran.rstudio.com
> 
>   There is a binary version available but
>   the source version is later:
>       binary source needs_compilation
> rJava 0.9-11 0.9-12              TRUE
> 
> installing the source package 'rJava'
> 
> trying URL 'https://cran.rstudio.com/src/contrib/rJava_0.9-12.tar.gz'
> Content type 'application/x-gzip' length 1103629 bytes (1.1 MB)
> downloaded 1.1 MB
> 
> * installing *source* package 'rJava' ...
> ** package 'rJava' successfully unpacked and MD5 sums checked
> ** using staged installation
> Generate Windows-specific files (src/jvm-w32) ...
> make: Entering directory 
> '/Users/spenc/AppData/Local/Temp/RtmpQbnYkA/R.INSTALL8ec5478248a/rJava/src/jvm-w32'
> c:/Rtools/mingw_64/bin/dlltool --as c:/Rtools/mingw_64/bin/as --input-def 
> jvm64.def --kill-at --dllname jvm.dll --output-lib libjvm.dll.a
> c:/Rtools/mingw_64/bin/gcc  -O2 -c -o findjava.o findjava.c
> c:/Rtools/mingw_64/bin/gcc  -s -o findjava.exe findjava.o
> make: Leaving directory 
> '/Users/spenc/AppData/Local/Temp/RtmpQbnYkA/R.INSTALL8ec5478248a/rJava/src/jvm-w32'
> Find Java...
>   JAVA_HOME=C:/PROGRA~1/Java/JRE18~1.0_2
> === Building JRI ===
>   JAVA_HOME=C:/PROGRA~1/Java/JRE18~1.0_2
>   R_HOME=C:/PROGRA~1/R/R-36~1.3
> JDK has no javah.exe - using javac -h . instead
> Creating Makefiles ...
> Configuration done.
> make -C src JRI.jar
> make[1]: Entering directory 
> '/Users/spenc/AppData/Local/Temp/RtmpQbnYkA/R.INSTALL8ec5478248a/rJava/jri/src'
> C:/PROGRA~1/Java/JRE18~1.0_2/bin/javac -h . -d . ../RList.java ../RBool.java 
> ../RVector.java ../RMainLoopCallbacks.java ../RConsoleOutputStream.java 
> ../Mutex.java ../Rengine.java ../REXP.java ../RFactor.java 
> ../package-info.java
> sh: C:/PROGRA~1/Java/JRE18~1.0_2/bin/javac: No such file or directory
> make[1]: *** [Makefile.all:41: org/rosuda/JRI/Rengine.class] Error 127
> make[1]: Leaving directory 
> '/Users/spenc/AppData/Local/Temp/RtmpQbnYkA/R.INSTALL8ec5478248a/rJava/jri/src'
> make: *** [Makefile.all:19: src/JRI.jar] Error 2
> **** WARNING: JRI could NOT be built
> Set IGNORE=1 if you want to build rJava anyway.
> ERROR: configuration failed for package 'rJava'
> * removing 'C:/Program Files/R/R-3.6.3/library/rJava'
> * restoring previous 'C:/Program Files/R/R-3.6.3/library/rJava'
> 
> The downloaded source packages are in
> 'C:\Users\spenc\AppData\Local\Temp\RtmpsDQIkn\downloaded_packages'
> Warning message:
> In install.packages(update[instlib == l, "Package"], l, repos = repos,  :
>   installation of package 'rJava' had non-zero exit status
> 
> > sessionInfo()
> R version 3.6.3 (2020-02-29)
> Platform: x86_64-w64-mingw32/x64 (64-bit)
> Running under: Windows 10 x64 (build 18362)
> 
> Matrix products: default
> 
> locale:
> [1] LC_COLLATE=English_United States.1252
> [2] LC_CTYPE=English_United States.1252
> [3] LC_MONETARY=English_United States.1252
> [4] LC_NUMERIC=C
> [5] LC_TIME=English_United States.1252
> 
> attached base packages:
> [1] stats     graphics  grDevices utils
> [5] datasets  methods   base
> 
> loaded via a namespace (and not attached):
> [1] compiler_3.6.3 tools_3.6.3
> 
> 
> On 2020-03-28 22:07, Simon Urbanek wrote:
>> Spencer,
>> 
>> you could argue that Java is dead since Oracle effectively killed it by 
>> removing all public downloads, but if you manage to get hold of a Java 
>> installation then it works just fine with R. To my best knowledge there has 
>> never been an issue if you installed rJava from source. macOS Catalina has 
>> made binary distributions impossible due to additional restrictions on 
>> run-time, but even that has been how solved with the release of rJava 
>> 0.9-12, so please make sure you use the latest rJava. In most cases that I 
>> have seen issues were caused by incorrect configuration (setting JAVA_HOME 
>> incorrectly [do NOT set it unless you know what you're doing!], not 
>> installing Java for the same architecture as R etc.). If you have any issues 
>> feel free to report them. rJava 0.9-12 has quite a few changes that try to 
>> detect user errors better and report them so I strongly suggest users to 
>> upgrade.
>> 
>> Cheers,
>> Simon
>> 
>> 
>>> On 29/03/2020, at 9:18 AM, Spencer Graves <spencer.gra...@prodsyse.com> 
>>> wrote:
>>> 
>>> Hello, All:
>>> 
>>> 
>>>       Is Java being deprecated for R?
>>> 
>>> 
>>>       I ask, because I've been unable to get rJava 0.9-11 to work under 
>>> either macOS 10.15 or Windows 10, and I can't get rJava 0.9-12 to install 
>>> -- and my Ecfun package uses it:   I can't get "R CMD build Ecfun" to work 
>>> on my Mac nor "R CMD check Ecfun_0.2-4" under Windows.  Travis CI builds 
>>> "https://github.com/sbgraves237/Ecfun"; just fine.
>>> 
>>> 
>>>       The rJava maintainer, Simon Urbanek, has kindly responded to two of 
>>> my three emails on this since 2020-03-20, but I've so far been unable to 
>>> translate his suggestions into fixes for these problems.
>>> 
>>> 
>>>       Should I remove rJava from Ecfun and see what breaks, then see if I 
>>> can work around that?  Should I provide the error messages I get for rJava 
>>> from "update.packages()" and / or library(rJava) on both machines, with 
>>> sessionInfo() to this list or to Stack Exchange or Stack Overflow?
>>> 
>>> 
>>>       Since I'm getting so many problems with rJava on under both macOS and 
>>> Windows 10, that suggests to me that potential users could have similar 
>>> problems, and I should try to remove rJava from Ecfun.
>>> 
>>> 
>>>       What do you think?
>>>       Thanks,
>>>       Spencer Graves
>>> 
>>> ______________________________________________
>>> R-devel@r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>> 
> 

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to