FS#46945 - R CMD javareconf fails on default install

Attached to Project: Arch Linux
Opened by FreakGuard (FreakGuard) - Monday, 02 November 2015, 12:26 GMT
Last edited by Doug Newgard (Scimmia) - Wednesday, 04 November 2015, 15:11 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
Running R CMD javareconf fails to detect the correct env variables.

Additional info:
* package version(s)
Java version: 8.u60-1
R version: 3.2.2

Workaround:
On line 218 in /usr/lib/R/bin/javareconf, replace

LD_LIBRARY_PATH=

with

LD_LIBRARY_PATH=/usr/lib/jvm/java-8-openjdk/jre/lib/amd64/server

Steps to reproduce:

sudo pacman -S jre8-openjdk-headless r jdk8-openjdk
sudo R CMD javareconf


Java interpreter : /usr/bin/java
Java version : 1.8.0_60
Java home path : /usr/lib/jvm/java-8-openjdk/jre
Java compiler : /usr/bin/javac
Java headers gen.: /usr/bin/javah
Java archive tool: /usr/bin/jar
/usr/java/packages/lib/amd64
/usr/lib64
/lib64
/lib
/usr/lib

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/usr/java/packages/lib/amd64 -L/usr/lib64 -L/lib64 -L/lib -L/usr/lib -ljvm
gcc -I/usr/include/R/ -DNDEBUG -I/usr/lib/jvm/java-8-openjdk/jre/../include -I/usr/lib/jvm/java-8-openjdk/jre/../include/linux -D_FORTIFY_SOURCE=2 -fpic -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -c conftest.c -o conftest.o
gcc -shared -L/usr/lib64/R/lib -Wl,-O1,--sort-common,--as-needed,-z,relro -o conftest.so conftest.o -L/usr/java/packages/lib/amd64 -L/usr/lib64 -L/lib64 -L/lib -L/usr/lib -ljvm -L/usr/lib64/R/lib -lR
/usr/bin/ld: cannot find -ljvm
collect2: error: ld returned 1 exit status
/usr/share/R//make/shlib.mk:6: recipe for target 'conftest.so' failed
make: *** [conftest.so] Error 1
Unable to compile a JNI program


JAVA_HOME : /usr/lib/jvm/java-8-openjdk/jre
Java library path:
JNI cpp flags :
JNI linker flags :
Updating Java configuration in /usr/lib64/R
Done.

This task depends upon

Closed by  Doug Newgard (Scimmia)
Wednesday, 04 November 2015, 15:11 GMT
Reason for closing:  Not a bug
Additional comments about closing:  User requested: Local misconfig.
Comment by FreakGuard (FreakGuard) - Monday, 02 November 2015, 12:33 GMT
The problem seems to be an incorrectly set java.library.path

scala> sys.props("java.library.path")
res0: String = /usr/lib:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib

However, I haven't found out where that config is coming from.

Loading...