Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation fails on JRI configuration (v0.9-10, Ubuntu 18.04, JDK 10, R 3.4.4) #146

Closed
zachwarner opened this issue May 3, 2018 · 8 comments

Comments

@zachwarner
Copy link

Hi. I'm working on a fresh Ubuntu 18.04 machine, but I can't get rJava to install. My setup is just:

sudo apt-get install -y default-jre
sudo apt-get install -y default-jdk
java -version
sudo R CMD javareconf

Followed in R by:

install.packages("https://www.rforge.net/rJava/snapshot/rJava_0.9-10.tar.gz", repos=NULL, type='source')

where I'm installing from source to fix the javah issue addressed in the recent patch. This fails to install with the following output:

Installing package into ‘/home/zach/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
trying URL 'https://www.rforge.net/rJava/snapshot/rJava_0.9-10.tar.gz'
Content type 'application/x-gzip' length 654583 bytes (639 KB)
==================================================

downloaded 639 KB
installing source package ‘rJava’ ...
checking for gcc... gcc -std=gnu99
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... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for string.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking whether time.h and sys/time.h may both be included... yes
configure: checking whether gcc -std=gnu99 supports static inline...
yes
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/bin/java'
archiver : '/usr/lib/jvm/default-java/bin/jar'
compiler : '/usr/lib/jvm/default-java/bin/javac'
header prep.: ''
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/lib/server -ljvm'
checking whether Java run-time works... yes
checking whether -Xrs is supported... yes
checking whether -Xrs will be used... yes
checking whether JNI programs can be compiled... yes
checking JNI data types... ok
checking whether JRI should be compiled (autodetect)... yes
checking whether debugging output should be enabled... no
checking whether memory profiling is desired... no
checking whether threads support is requested... no
checking whether callbacks support is requested... no
checking whether JNI cache support is requested... no
checking whether headless init is enabled... no
checking whether JRI is requested... yes
configure: creating ./config.status
config.status: creating src/Makevars
config.status: creating R/zzz.R
config.status: creating src/config.h
=== configuring in jri (/tmp/RtmpdHxU8I/R.INSTALL7ffe715eff49/rJava/jri)
configure: running /bin/bash ./configure --disable-option-checking '--prefix=/usr/local' --cache-file=/dev/null --srcdir=.
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for gcc... gcc -std=gnu99
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... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking Java version...
checking whether actually works... no
checking whether javah was replaced by javac -h... no
configure: error: one or more Java tools are missing.

*** JDK is incomplete! Please make sure you have a complete JDK. JRE is not sufficient.
configure: error: ./configure failed for jri
ERROR: configuration failed for package ‘rJava’
removing ‘/home/zach/R/x86_64-pc-linux-gnu-library/3.4/rJava’

Here's the output from the java -version call:

Java interpreter : /usr/lib/jvm/default-java/bin/java
Java version : 10.0.1
Java home path : /usr/lib/jvm/default-java
Java compiler : /usr/lib/jvm/default-java/bin/javac
Java headers gen.:
Java archive tool: /usr/lib/jvm/default-java/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
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I/usr/lib/jvm/default-java/include -I/usr/lib/jvm/default-java/include/linux -fpic -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c conftest.c -o conftest.o
g++ -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o conftest.so conftest.o -L/usr/lib/jvm/default-java/lib/server -ljvm -L/usr/lib/R/lib -lR

JAVA_HOME : /usr/lib/jvm/default-java
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
Done.

...And finally, my sessionInfo():

R version 3.4.4 (2018-03-15)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04 LTS

Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/openblas/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/libopenblasp-r0.2.20.so

locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_GB.UTF-8 LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_GB.UTF-8
[6] LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_GB.UTF-8 LC_NAME=C LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics grDevices utils datasets methods base

loaded via a namespace (and not attached):
[1] compiler_3.4.4 tools_3.4.4 yaml_2.1.19

Thanks for your help.

@edent
Copy link

edent commented May 6, 2018

I'm having the same problem on MacOS High Sierra.

Have followed the instructions at http://www.owsiak.org/r-java-rjava-and-macos-adventures/ - and several other places - still can't get it to work.

@gsgxnet
Copy link

gsgxnet commented May 10, 2018

I have the same issue on openSUSE Tumbleweed with R 3.5.0 and openjdk 10.0.1. Wrongly stated that as a comment to issue 137:
#137 (comment)

@s-u s-u closed this as completed in 5967273 May 14, 2018
@s-u
Copy link
Owner

s-u commented May 14, 2018

Thanks, OpenJDK doesn't identify itself as Java so it was not detected as Java 1x version and thus the javah work-around was not applied. Should be now fixed - we no longer require the JDK to call itself Java.

@gsgxnet
Copy link

gsgxnet commented May 15, 2018

Thanks,

works for me now under openSUSE and openjdk 10.0.1, having installed direct from rforge.

@zachwarner
Copy link
Author

Fixed my issue as well. Thanks!

@AlexSh1mada
Copy link

hello @edent, I'm also having issues with installing rJava on High Sierra, were you able to get around the issue?

@edent
Copy link

edent commented Jun 20, 2018

No, sorry. I gave up and used Ubuntu.

@mgrogger
Copy link

I'm also still having the same problem on OS High Sierra, have there been any updates to this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants