Kaja
Kaja

Reputation: 3057

Cannot compile a simple JNI program on Debian Wheezhy

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?

Upvotes: 16

Views: 17229

Answers (2)

jrpereirajr
jrpereirajr

Reputation: 361

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

sudo R CMD javareconf

Upvotes: 24

Fabio Ciotoli
Fabio Ciotoli

Reputation: 165

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!

Upvotes: 15

Related Questions