Dirk,

to clarify - this is about *R* configuration, not about rJava at all. rJava has 
nothing to do with those settings - it just uses what R was configured with. 
The only part rJava plays here is that it needs those R settings to be valid - 
just like other R packages that use Java.

As you reported the R configuration is broken, because the JAVA entry points to 
a non-existent file. I don't know why or how that happens. At least that's what 
I saw in the log:

checking Java support in R... present:
interpreter : '/usr/lib/jvm/default-java/jre/bin/java'
[...]
checking whether Java run-time works... ./configure: line 3736: 
/usr/lib/jvm/default-java/jre/bin/java: No such file or directory
no
configure: error: Java interpreter '/usr/lib/jvm/default-java/jre/bin/java' 
does not work

I presume that setting should have been /usr/lib/jvm/default-java/bin/java -- 
or JRE is required and missing (again, I don't know what package is providing 
that /usr/lib/jvm/default-java/jre/bin/java file used in the configuration).

Cheers,
Simon


> On Oct 19, 2017, at 4:56 PM, Dirk Eddelbuettel <e...@debian.org> wrote:
> 
> 
> On 19 October 2017 at 16:31, Simon Urbanek wrote:
> | 
> | > On Oct 19, 2017, at 4:12 PM, Dirk Eddelbuettel <e...@debian.org> wrote:
> | > 
> | > 
> | > On 19 October 2017 at 15:47, Simon Urbanek wrote:
> | > | R CMD javareconf is always needed to register Java support with R (on 
> all unix platforms).
> | > 
> | > s/always/sometimes/
> | > 
> | > The values get encoded when I build R binaries.  For many years now, that 
> was
> | > good enough. 
> | > 
> | > | Like I said, I don't know what deb packages do here -
> | > 
> | > 'R CMD INSTALL sourceTarball_1.2-3.tar.gz  -- what else do you think I do?
> | > 
> | > | I presume you must do something in your R binary and all I can presume 
> is that whatever the setup is then doesn't match what's there now.
> | > 
> | > 500+ CRAN packages packaged _exactly_ this.  rJava is a little different 
> (for
> | > an understandable reason; RInside is different too).
> | > 
> | > So ... tried that, still no luck:
> | > 
> | > ---
> | > [...]
> | > R CMD javareconf
> | > *** JAVA_HOME is not a valid path, ignoring
> | > Java interpreter : /usr/bin/java
> | > Java version     : 9-Debian
> | > Java home path   : /usr/lib/jvm/java-9-openjdk-amd64
> | > Java compiler    : /usr/bin/javac
> | > Java headers gen.: /usr/bin/javah
> | > Java archive tool: /usr/bin/jar
> | > 
> | > trying to compile and link a JNI program
> | > detected JNI cpp flags    : -I$(JAVA_HOME)/include 
> -I$(JAVA_HOME)/include/linux
> | > detected JNI linker flags : -L$(JAVA_HOME)/lib/server -ljvm
> | > make[1]: Entering directory '/tmp/Rjavareconf.e0Jzrq'
> | > gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG 
> -I/usr/lib/jvm/java-9-openjdk-amd64/include 
> -I/usr/lib/jvm/java-9-openjdk-amd64/include/linux     -fpic  -g -O2 
> -fdebug-prefix-map=/build/r-base-3.4.2=. -fstack-protector-strong -Wformat 
> -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c conftest.c -o 
> conftest.o
> | > gcc -std=gnu99 -shared -L/usr/lib/R/lib -Wl,-z,relro -o conftest.so 
> conftest.o -L/usr/lib/jvm/java-9-openjdk-amd64/lib/server -ljvm 
> -L/usr/lib/R/lib -lR
> | > make[1]: Leaving directory '/tmp/Rjavareconf.e0Jzrq'
> | > 
> | > 
> | > JAVA_HOME        : /usr/lib/jvm/java-9-openjdk-amd64
> | > Java library path: $(JAVA_HOME)/lib/server
> | > JNI cpp flags    : -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
> | > JNI linker flags : -L$(JAVA_HOME)/lib/server -ljvm
> | > Updating Java configuration in /usr/lib/R
> | > /usr/lib/R/bin/javareconf: 406: /usr/lib/R/bin/javareconf: cannot create 
> /usr/lib/R/etc/Makeconf.new: Permission denied
> | > *** cannot create /usr/lib/R/etc/Makeconf.new
> | > *** Please run as root if required.
> | > [...]
> | > ---
> | > 
> | > All this is running as root.  But /usr may be mounted read-only.
> | > 
> | 
> | Right, you have to have write-access is /usr/lib/R/etc/ so it can update 
> the configuration to record your Java settings.
> 
> Well, in general we do _not_ have that and _cannot_ assume it, just like CRAN
> packages do _not_ get to write to $RHOME/bin.
> 
> _For Debian systems_ I offer (us, mostly) /etc/R/ with softlinks.
> 
> But if your package assumes /usr/lib for write only, we may be done here and
> it will get removed.
> 
> | I was asking because the above it obviously non-portable - i.e. if I
> | install Oracle Java the path will be different and also it will be different
> | for Java 1.8 etc. Hence you'd need to re-run javareconf any time the Java
> | configuration changes (thanks to Sun/Oracle for that wonderful design) -
> | unless you have canonical place you can use. From your original settings it
> | looked like you have some default-java symlink which would help here -
> 
> Not mine. That is the Debian Java folks.
> 
> | except that it has the broken path to java which is where the trouble 
> started in the first place. I suspect that fixing your default config to have 
> a valid path to java should be enough as long as that default setting is 
> maintained at the system level.
> 
> No trouble _once I run R CMD javareconf_ earlier it built.  But we died in in
> your post-processing, it seems.
> 
> Dirk
> 
> | Cheers,
> | Simon
> | 
> | 
> | 
> | > Dirk
> | > | 
> | > | Cheers,
> | > | Simon
> | > | 
> | > | 
> | > | > On Oct 18, 2017, at 9:50 PM, Dirk Eddelbuettel <e...@debian.org> 
> wrote:
> | > | > 
> | > | > 
> | > | > Simon,
> | > | > 
> | > | > On 18 October 2017 at 21:34, Simon Urbanek wrote:
> | > | > | Dirk,
> | > | > | 
> | > | > | I don't have the details but this looks like as incorrect Java 
> configuration in R - the Java home is obviously incomplete as it's missing 
> bin/java and/or that path is wrong. Also I'm surprised to the the odd paths 
> "/usr/lib/jvm/default-java/" since at least in my installations I see the 
> actual JVM being used - but then I don't know how your package (or Debian?) 
> abstracts the Java version mess.
> | > | > 
> | > | > This was vanilla 'openjdk-9-jdk' and nothing else.
> | > | > 
> | > | > Could I / should invoke 'R CMD javareconf' ?
> | > | > 
> | > | > Dirk
> | > | > 
> | > | > | Cheers,
> | > | > | Simon
> | > | > | 
> | > | > | 
> | > | > | > On Oct 17, 2017, at 10:24 PM, Dirk Eddelbuettel <e...@debian.org> 
> wrote:
> | > | > | > 
> | > | > | > 
> | > | > | > Simon,
> | > | > | > 
> | > | > | > With your new rJava_0.9-9 I tried this against Debian's 
> openjdk-9-jdk -- but
> | > | > | > with R 3.4.2 as built against openjdk-7 -- and it still fails:
> | > | > | > 
> | > | > | > checking whether setjmp.h is POSIX.1 compatible... yes
> | > | > | > checking whether sigsetjmp is declared... yes
> | > | > | > checking whether siglongjmp is declared... yes
> | > | > | > checking Java support in R... present:
> | > | > | > interpreter : '/usr/lib/jvm/default-java/jre/bin/java'
> | > | > | > archiver    : '/usr/lib/jvm/default-java/bin/jar'
> | > | > | > compiler    : '/usr/lib/jvm/default-java/bin/javac'
> | > | > | > header prep.: '/usr/lib/jvm/default-java/bin/javah'
> | > | > | > cpp flags   : '-I/usr/lib/jvm/default-java/include 
> -I/usr/lib/jvm/default-java/include/linux'
> | > | > | > java libs   : '-L/usr/lib/jvm/default-java/jre/lib/amd64/server 
> -ljvm'
> | > | > | > checking whether Java run-time works... ./configure: line 3736: 
> /usr/lib/jvm/default-java/jre/bin/java: No such file or directory
> | > | > | > no
> | > | > | > configure: error: Java interpreter 
> '/usr/lib/jvm/default-java/jre/bin/java' does not work
> | > | > | > ERROR: configuration failed for package 'rJava'
> | > | > | > * removing 
> '/build/rjava-0.9-9/debian/r-cran-rjava/usr/lib/R/site-library/rJava'
> | > | > | > /usr/share/R/debian/r-cran.mk:101: recipe for target 'R_any_arch' 
> failed
> | > | > | > make: *** [R_any_arch] Error 1
> | > | > | > dpkg-buildpackage: error: fakeroot debian/rules binary gave error 
> exit status 2
> | > | > | > 
> | > | > | > 
> | > | > | > Any ideas?  I saw that r-devel got some changes related to 
> javareconf.  Do we
> | > | > | > need to port that to r-patched?  Can you advise?
> | > | > | > 
> | > | > | > Many thanks,  Dirk
> | > | > | > 
> | > | > | > -- 
> | > | > | > http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org
> | > | > | > 
> | > | > | 
> | > | > 
> | > | > -- 
> | > | > http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org
> | > | > 
> | > | 
> | > 
> | > -- 
> | > http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org
> | > 
> | 
> 
> -- 
> http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org
> 

Reply via email to