[R] Ubunut + Eclipse + StatET: Console terminates upon error

Janko Thyson janko.thyson at ku-eichstaett.de
Thu Mar 11 20:19:26 CET 2010


Thanks for the quick reply. I was following your hint with "rJava", but I'm still a little lost.

I maybe should have added that the console terminating happens when launching it as "Rterm", it works fine when running it as "RJ". However, I would like to use "Rterm". Here is what I did so far:

First of, I'm still confused about Ubuntu's "sudo" way of doing things. Not knowing how to authorize me as "root" when installing packages from a R-script, I can't write on "/usr/local/lib/R/site-library" or "/usr/lib/R/site-library". So I turned to Synaptics, found and installed the CRAN package "rJava" that enables me to run the R console with Launch Type "RJ" within Eclipse. "rJava" went into "/usr/lib". 

Then, launching R as "RJ" and trying to execute an "install.packages()", Ubuntu prompted me for the specification of a valid library directory and offered to create "/home/<ME>/i486-pc-linux-gnu-library/2.10". 

So ".libPaths()" would give me:
    R> .libPaths()
    [1] "/home/<ME>/i486-pc-linux-gnu-library/2.10" "/usr/lib/R/site-library"       
    [3] "/usr/lib/R/library"           
    R>

I then tried to "re-install" the package "rJava" by "install.packages()" which got me the following output:

+++++

install.packages("rJava", repos=repos.cran, lib="/home/<ME>/R/i486-pc-linux-gnu-library/2.10")
trying URL 'http://cran.at.r-project.org/src/contrib/rJava_0.8-2.tar.gz'
Content type 'application/x-gzip' length 471971 bytes (460 Kb)
opened URL
==================================================
downloaded 460 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 -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 ‘/home/<ME>/R/i486-pc-linux-gnu-library/2.10/rJava’

The downloaded packages are in
	‘/tmp/RtmpbGKuzS/downloaded_packages’
Warning message:
In install.packages("rJava", repos = repos.cran, lib = "/home/<ME>/R/i486-pc-linux-gnu-library/2.10") :
  installation of package 'rJava' had non-zero exit status

+++++

So I ran "sudo R CMD javareconf", but still get the same error.

Any hints from here on?

Thanks a lot!

Janko

-----Ursprüngliche Nachricht-----
Von: Dirk Eddelbuettel [mailto:edd at debian.org] 
Gesendet: Donnerstag, 11. März 2010 19:40
An: Janko Thyson
Cc: r-help at r-project.org; tobias.verbeke at openanalytics.eu
Betreff: Re: [R] Ubunut + Eclipse + StatET: Console terminates upon error


On 11 March 2010 at 19:19, Janko Thyson wrote:
| I'm trying to set up Eclispe (3.5.1) with the StatET-Plugin (0.8.1) under
| Ubuntu (Karmic) and found it strange that my console terminates every time
| something in a script produces an arbitrary error (e.g. just calling a
| missing variable, trying to perform an illegal operation etc.). Can anyone
| tell me why this happens or even better how to fix this?

It so happens that I help a colleague recently to triage this.  The problem
there was that a recent rJava was needed + and installed -- and on Ubuntu and
Debian this goes into 

       /usr/local/lib/R/site-library/

and StatET -- as shipped -- does not look there.  I don't use Eclipse so I
don't recall where to set this, but in essence you need to make sure that
StatET looks where R puts things. And that tends to be

    R> .libPaths()
    [1] "/usr/local/lib/R/site-library" "/usr/lib/R/site-library"       
    [3] "/usr/lib/R/library"           
    R> 

CCing Tobias just in case.

Dirk

-- 
  Registration is open for the 2nd International conference R / Finance 2010
  See http://www.RinFinance.com for details, and see you in Chicago in April!



More information about the R-help mailing list