2
2
I have a problem with installing the newest version of R, an error "fatal error: jni.h: No such file or directory" that I don't understand appeared. Here is what I did before getting an error in the installation of R :
#download tar.gz file
https://cran.r-project.org/
#install because we need it for execution of "make"
sudo apt-get install libx11-dev
sudo apt-get install xorg-dev
sudo apt-get install libcurl4-openssl-dev
# decompile
# on terminal
./configure
make
What appeared to me at the end of the installation after installing libraries was this (can't paste everything because it is too long):
installing to /home/fafnyr/R/R-3.5.2/library/mgcv/libs
** R
** data
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (mgcv)
make[2]: Leaving directory '/home/fafnyr/R/R-3.5.2/src/library/Recommended'
make[1]: Leaving directory '/home/fafnyr/R/R-3.5.2/src/library/Recommended'
make[1]: Entering directory '/home/fafnyr/R/R-3.5.2/src/library'
building/updating vignettes for package 'grid' ...
building/updating vignettes for package 'parallel' ...
building/updating vignettes for package 'utils' ...
make[1]: Leaving directory '/home/fafnyr/R/R-3.5.2/src/library'
make[1]: Entering directory '/home/fafnyr/R/R-3.5.2'
configuring Java ...
Java interpreter : /usr/bin/java
Java version : 10.0.2
Java home path : /usr/lib/jvm/java-11-openjdk-amd64
Java compiler : not present
Java headers gen.:
Java archive tool:
trying to compile and link a JNI program
detected JNI cpp flags :
detected JNI linker flags : -L$(JAVA_HOME)/lib/server -ljvm
make[2]: Entering directory '/tmp/Rjavareconf.VwU72a'
gcc -I"/home/fafnyr/R/R-3.5.2/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -c conftest.c -o conftest.o
conftest.c:1:10: fatal error: jni.h: No such file or directory
#include <jni.h>
^~~~~~~
compilation terminated.
/home/fafnyr/R/R-3.5.2/etc/Makeconf:162: recipe for target 'conftest.o' failed
make[2]: *** [conftest.o] Error 1
make[2]: Leaving directory '/tmp/Rjavareconf.VwU72a'
Unable to compile a JNI program
JAVA_HOME : /usr/lib/jvm/java-11-openjdk-amd64
Java library path:
JNI cpp flags :
JNI linker flags :
Updating Java configuration in /home/fafnyr/R/R-3.5.2
Done.
make[1]: Leaving directory '/home/fafnyr/R/R-3.5.2'
Seems like this question addresses the issue on Stack Overflow.
– JakeGould – 2019-02-11T15:58:56.813