Problem: before upgrading, under Ubuntu14.04, I just installed the default JRE and JDK, and R 3.0.2 (the default for that rev of Ubuntu),and sucessfully ran R CMD javareconf.

However, since upgrading to 14.10, and verifying I have the latest java7 JRE and JDK, trying to run the javareconf fails with the following dump:

cellocgw@cellocgw-Studio-1747:~$ sudo R CMD javareconf
Java interpreter : /usr/bin/java
Java version     : 1.7.0_65
Java home path   : /usr/lib/jvm/java-7-openjdk-amd64/jre
Java compiler    : /usr/bin/javac
Java headers gen.: /usr/bin/javah
Java archive tool: /usr/bin/jar

trying to compile and link a JNI progam 
detected JNI cpp flags    : -I$(JAVA_HOME)/../include
detected JNI linker flags : -L$(JAVA_HOME)/lib/amd64/server -ljvm
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I/usr/lib/jvm/java-7-openjdk-amd64/jre/../include     -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c conftest.c -o conftest.o
In file included from conftest.c:1:0:
/usr/lib/jvm/java-7-openjdk-amd64/jre/../include/jni.h:39:19: fatal error: stdio.h: No such file or directory
 #include <stdio.h>
compilation terminated.
/usr/lib/R/etc/Makeconf:133: recipe for target 'conftest.o' failed
make: *** [conftest.o] Error 1
Unable to compile a JNI program

JAVA_HOME        : /usr/lib/jvm/java-7-openjdk-amd64/jre
Java library path: 
JNI cpp flags    : 
JNI linker flags : 
Updating Java configuration in /usr/lib/R

Something is not installed or isn't where it "should" be. I've tried most of the tricks listed at similar questions (doing updates and the like), but so far I haven't found a question where the stdio.h file missing was the error message.

  • If it's really looking for the <stdio.h> standard C library header, then that would require the libc6-dev package I think – steeldriver Dec 6 '14 at 14:53
  • @steeldriver that sounds unlikely - I would have expected a stdio.h file right in the current ../include directory – Carl Witthoft Dec 6 '14 at 15:09
  • @steeldriver Looks like you were correct. See my answer; if you'd like to post a more precise answer I'll be happy to select your version. – Carl Witthoft Dec 6 '14 at 16:12

I think I've solved this situation:

Based on a comment from steeldriver , I dug into the Software Center and added several "add-ons" to the gcc installation. I suspect that adding either libc6-dev or gcc-multilib was what I needed.

On a related note of probable interest to R users who want to install JGR : I had to install at least one of libpng12-dev, libpng3 , and libpng++dev to get the package png to install (in R), which is required for JGR to install.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.