Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot compile a simple JNI program on Debian Wheezhy

Tags:

r

debian

I have installed R on a Debian Wheezhy. I want to install rjava package, but I get this error:

configure: error: Cannot compile a simple JNI program. See config.log for details.

Make sure you have Java Development Kit installed and correctly registered in R.
If in doubt, re-run "R CMD javareconf" as root.

ERROR: configuration failed for package ‘rJava’
* removing ‘/home/babak/R/x86_64-pc-linux-gnu-library/2.15/rJava’

There is Java on my Linux, If I type Java -Version I see:

java version "1.6.0_27"
OpenJDK Runtime Environment (IcedTea6 1.12.6) (6b24-1.11.5-1)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)

How can I solve this problem?

like image 796
Kaja Avatar asked Feb 26 '14 13:02

Kaja


Video Answer


2 Answers

I have solved the problem using this command - shown in error description:

sudo R CMD javareconf
like image 103
jrpereirajr Avatar answered Sep 28 '22 00:09

jrpereirajr


I had a similar problem while installing xlsx package that has some dependencies maybe related to java and r java packages...

In order to solve your problem you have to: - check environment variables $JAVA_HOME and $PATH - sudo R CMD javareconf

If it doesn't help, try out my configuration with java-7-oracle,

  • install java-7-oracle via webupd8 repository Installing Java 7 (Oracle) in Debian via apt-get
    • set environment variables $JAVA_HOME and $PATH
    • export JAVA_HOME=/usr/lib/jvm/java-7-oracle
    • export PATH=$PATH:$JAVA_HOME/bin
  • sudo update-java-alternatives -s java-7-oracle
  • sudo R CMD javareconf

and than retry the installation of rjava

I hope it will help you!

like image 43
Fabio Ciotoli Avatar answered Sep 28 '22 00:09

Fabio Ciotoli