[BioC] error while installing Java related packages

Martin Morgan mtmorgan at fhcrc.org
Wed Mar 16 14:46:52 CET 2011


On 03/16/2011 05:01 AM, MLSC MANIPAL wrote:
> *Dear Sir,
> I have successfully installed jdk and rJava using the following commands:
>
> sudo apt-get install r-cran-rjava
>
> sudo apt-get install sun-java6-jdk sun-java6-jre
>
> But when I try to install using : install.packages("rJava"), it is giving
> the follwinfg error:
> *
> Warning in install.packages("rJava") :
>    argument 'lib' is missing: using '/usr/local/lib/R/site-library'
> --- Please select a CRAN mirror for use in this session ---
> Loading Tcl/Tk interface ... done
> trying URL 'http://cran.ma.imperial.ac.uk/src/contrib/rJava_0.8-8.tar.gz'
> Content type 'application/x-gzip' length 522057 bytes (509 Kb)
> opened URL
> ==================================================
> downloaded 509 Kb
>
> * installing *source* package ‘rJava’ ...
> checking for gcc... gcc -std=gnu99
> checking for C compiler default output file name... a.out
> checking whether the C compiler works... yes
> checking whether we are cross compiling... no
> checking for suffix of executables...
> checking for suffix of object files... o
> checking whether we are using the GNU C compiler... yes
> checking whether gcc -std=gnu99 accepts -g... yes
> checking for gcc -std=gnu99 option to accept ISO C89... none needed
> checking how to run the C preprocessor... gcc -std=gnu99 -E
> checking for grep that handles long lines and -e... /bin/grep
> checking for egrep... /bin/grep -E
> checking for ANSI C header files... yes
> checking for sys/wait.h that is POSIX.1 compatible... yes
> checking for sys/types.h... yes
> checking for sys/stat.h... yes
> checking for stdlib.h... yes
> checking for string.h... yes
> checking for memory.h... yes
> checking for strings.h... yes
> checking for inttypes.h... yes
> checking for stdint.h... yes
> checking for unistd.h... yes
> checking for string.h... (cached) yes
> checking sys/time.h usability... yes
> checking sys/time.h presence... yes
> checking for sys/time.h... yes
> checking for unistd.h... (cached) yes
> checking for an ANSI C-conforming const... yes
> checking whether time.h and sys/time.h may both be included... yes
> configure: checking whether gcc -std=gnu99 supports static inline...
> yes
> checking whether setjmp.h is POSIX.1 compatible... yes
> checking whether sigsetjmp is declared... yes
> checking whether siglongjmp is declared... yes
> checking Java support in R... present:
> interpreter : '/usr/bin/java'
> archiver    : '/usr/bin/jar'
> compiler    : '/usr/bin/javac'
> header prep.: '/usr/bin/javah'
> cpp flags   : ''
> java libs   : '-L/usr/lib/jvm/java-6-openjdk/jre/lib/i386/server
> -L/usr/lib/jvm/java-6-openjdk/jre/lib/i386
> -L/usr/lib/jvm/java-6-openjdk/jre/../lib/i386 -L/usr/java/packages/lib/i386
> -L/usr/lib/jni -L/lib -L/usr/lib -ljvm'
> configure: error: One or more Java configuration variables are not set.
> 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 ‘/usr/local/lib/R/site-library/rJava’
> * restoring previous ‘/usr/local/lib/R/site-library/rJava’
>
> The downloaded packages are in
>      ‘/tmp/Rtmpp8n1WE/downloaded_packages’
> Warning message:
> In install.packages("rJava") :
>    installation of package 'rJava' had non-zero exit status
>
> *The same problem while installing Java related web packages such as
> RWebService,Sjava,JavaGD etc...
> *
> *I am using R version 2.11.1 (2010-05-31)*
>
> *I already run the following command in root  and it was successful: R CMD
> javareconf
>
> *Java interpreter : /usr/bin/java
> Java version     : 1.6.0_20
> Java home path   : /usr/lib/jvm/java-6-openjdk/jre
> Java compiler    : /usr/bin/javac
> Java headers gen.: /usr/bin/javah
> Java archive tool: /usr/bin/jar
> Java library path:
> $(JAVA_HOME)/lib/i386/server:$(JAVA_HOME)/lib/i386:$(JAVA_HOME)/../lib/i386:/usr/java/packages/lib/i386:/usr/lib/jni:/lib:/usr/lib
> JNI linker flags : -L$(JAVA_HOME)/lib/i386/server -L$(JAVA_HOME)/lib/i386
> -L$(JAVA_HOME)/../lib/i386 -L/usr/java/packages/lib/i386 -L/usr/lib/jni
> -L/lib -L/usr/lib -ljvm
> JNI cpp flags    :

Both rJava and SJava have this in their configuration file

if test -n "${JAVA}" && test -n "${JAVAC}" && test -n "${JAVAH}" && \
    test -n "${JAVA_CPPFLAGS}" && test -n "${JAVA_LIBS}" && test -n 
"${JAR}"; then
   have_all_flags=yes;
fi

so I suspect they fail because JAVA_CPPFLAGS is '' (for me, this has the 
value -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux). It seems 
like R CMD javareconf should be determining this (javareconf is in 
R_HOME/bin/). You might manually edit R_HOME/etc/ so that JAVA_CPPFLAGS 
points to something appropriate (the location of the include files 
requires for your java installation).

It might help to install a newer version of R.

Martin

> Updating Java configuration in /etc/R
> Done.*
>
> *
>
> *
> *
>
> *Hence, Can you please suggest me a solution for this?*
>
> * *
>
> *Thanking you in anticipation.*
>
> * *
>
> *Regards,*
>
> *Rayan*
>
> 	[[alternative HTML version deleted]]
>
>
>
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor


-- 
Computational Biology
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109

Location: M1-B861
Telephone: 206 667-2793



More information about the Bioconductor mailing list