Parece que você pode ter o JRE (Java Runtime Environment) instalado, mas não o JDK (Java Development Kit).
Tente:
sudo apt-get install openjdk-6-jdk
Em seguida, tente instalar o pacote novamente.
Estou tentando instalar o pacote RWeka para o R 2.14.1 rodando no Ubuntu Linux 12.04. Eu digito:
install.packages("RWeka")
escolha um espelho e faça o download.
Então eu recebo estas mensagens:
configure: error: Java Development Kit (JDK) is missing or not registered in R
Make sure R is configured with full Java support (including JDK). Run
R CMD javareconf
as root to add Java support to R.
If you don't have root privileges, run
R CMD javareconf -e
to set all Java-related variables and then install rJava.
ERROR: configuration failed for package ‘rJava’
* removing ‘/home/~/R/x86_64-pc-linux-gnu-library/2.14/rJava’
ERROR: dependency ‘rJava’ is not available for package ‘RWekajars’
* removing ‘/home/~/R/x86_64-pc-linux-gnu-library/2.14/RWekajars’
ERROR: dependencies ‘RWekajars’, ‘rJava’ are not available for package ‘RWeka’
* removing ‘/home/~/R/x86_64-pc-linux-gnu-library/2.14/RWeka’
The downloaded packages are in
‘/tmp/RtmpZBJDM0/downloaded_packages’
Warning messages:
1: In install.packages("RWeka") :
installation of package ‘rJava’ had non-zero exit status
2: In install.packages("RWeka") :
installation of package ‘RWekajars’ had non-zero exit status
3: In install.packages("RWeka") :
installation of package ‘RWeka’ had non-zero exit status
Então paro e digito:
sudo apt-get install icedtea-7-plugin
Deixe isso acontecer, então:
root@ubuntu:~# R CMD javareconf
Java interpreter : /usr/bin/java
Java version : 1.6.0_24
Java home path : /usr/lib/jvm/java-6-openjdk-amd64/jre
Java compiler : not present
Java headers gen.:
Java archive tool:
Java library path: /usr/lib/jvm/java-6-openjdk-amd64/jre/lib/amd64/server:/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/amd64:/usr/lib/jvm/java-6-openjdk-amd64/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib
JNI linker flags : -L/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/amd64/server -L/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/amd64 -L/usr/lib/jvm/java-6-openjdk-amd64/jre/../lib/amd64 -L/usr/java/packages/lib/amd64 -L/usr/lib/x86_64-linux-gnu/jni -L/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu -L/usr/lib/jni -L/lib -L/usr/lib -ljvm
JNI cpp flags :
Updating Java configuration in /etc/R
Done.
Então eu volto e inicio o R e tipo install.packages ("RWeka")
e receba a mesma mensagem de erro de antes.
Alguma sugestão?