[R] Getting JRI/rJava to work

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri May 16 12:24:58 CEST 2008


On Fri, 16 May 2008, john seers (IFR) wrote:

>
> Hello All
>
> I am trying to get the JRI examples from rJava to work on Windows XP and
> failing. (And as a more general and connected question is there any
> review/summary of front-end software for R?)
>
> I have installed rJava from the Windows binary supplied. I compile and
> run the example supplied (rtest.java) and get the results below. I do
> not think the notes about a deprecated API are a problem. But I do not
> know what causes the unsupported conversion messages.

Trying to run R in a non-existent locale (or at least in a charset iconv() 
does not understand).  However, your example (with suitably modified 
paths) does work for me in apparently the same locale, so I cannot debug 
it for you.

I do think the R posting guide clearly indicates this as off-topic for 
R-help -- it is a non-R programming issue involving a contributed package.

>
> Versions used etc below.
>
> Any ideas please? Thanks for any help.
>
> Regards
>
>
> John Seers
>
> ########################################################################
> ####################
>
> C:\temp\JRI\examples>javac -cp "C:/Program
> Files/R/mylibrary/rJava/jri/JRI.jar" rtest.java
> Note: rtest.java uses or overrides a deprecated API.
> Note: Recompile with -Xlint:deprecation for details.
>
> C:\temp\JRI\examples>java -Djava.library.path="C:/Program
> Files/R/mylibrary/rJava/jri" -cp .;"C:/Program
> Files/R/mylibrary/rJava/jri/JRI.jar" rtest
> Creating Rengine (with arguments)
> Error in structure(.Internal(Sys.getenv(as.character(x),
> as.character(unset))),  :
>  unsupported conversion
>
> R version 2.7.0 (2008-04-22)
> Copyright (C) 2008 The R Foundation for Statistical Computing
> ISBN 3-900051-07-0
>
> R is free software and comes with ABSOLUTELY NO WARRANTY.
> You are welcome to redistribute it under certain conditions.
> Type 'license()' or 'licence()' for distribution details.
>
>  Natural language support but running in an English locale
>
> R is a collaborative project with many contributors.
> Type 'contributors()' for more information and
> 'citation()' on how to cite R or R packages in publications.
>
> Type 'demo()' for some demos, 'help()' for on-line help, or
> 'help.start()' for an HTML browser interface to help.
> Type 'q()' to quit R.
>
> Error in file.info(lib.loc) : unsupported conversion in
> 'filenameToWchar'
> Error in file.exists(name) : unsupported conversion in 'filenameToWchar'
> rShowMessage "Fatal error: unable to restore saved data in .RData
>
> "
>
> C:\temp\JRI\examples>
>
> ########################################################################
> ######################
>
>
> C:\temp\JRI\examples>which java
> /cygdrive/c/Program Files/Java/jdk1.6.0_06/bin/java
>
> C:\temp\JRI\examples>which javac
> /cygdrive/c/Program Files/Java/jdk1.6.0_06/bin/javac
>
> C:\temp\JRI\examples>
>
>> sessionInfo()
> R version 2.7.0 (2008-04-22)
> i386-pc-mingw32
>
> locale:
> LC_COLLATE=English_United Kingdom.1252;LC_CTYPE=English_United
> Kingdom.1252;LC_MONETARY=English_United
> Kingdom.1252;LC_NUMERIC=C;LC_TIME=English_United Kingdom.1252
>
> attached base packages:
> [1] stats     graphics  grDevices datasets  utils     methods   base
>
>
> other attached packages:
> [1] rJava_0.5-1   RWinEdt_1.8-0
>>
>
>
>
> ---
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list