[R] Installing RWeka package in CentOS 5: problems with JAVA?

Paulo Cortez pcortez at dsi.uminho.pt
Wed Oct 1 11:54:04 CEST 2008


Hi,

I am a R user, with some experience in MacOS, Linux, etc, but I am 
having a problem that I cannot solve:

I have a linux server (CentOS 5) and I installed sun jdk1.6. For instance:

$ java -version
Java version "1.6.0_10-rc2"
Java(TM) SE Runtime Environment (build 1.6.0_10-rc2-b32)
Java HotSpot(TM) Server VM (build 11.0-b15, mixed mode)

I also installed the latest version of R:
 > R version 2.7.2 (2008-08-25)

I need to install the package tm, which requires RWeka.
So my first attempt was:

 > 
install.packages("tm",repos="http://cran.cnr.berkeley.edu/",dependencies=TRUE)

Under R. Yet, I got an error related with the RWeka package. Hence, I
downloaded directly the .tgz file and tryed to install it (as root):

$ wget http://cran.cnr.berkeley.edu/src/contrib/RWeka_0.3-14.tar.gz
$ R CMD INSTALL RWeka_0.3-14.tar.gz

* Installing to library '/usr/lib/R/library'
* Installing *source* package 'RWeka' ...
Exception in thread "main" java.lang.NoClassDefFoundError: getsp
Caused by: java.lang.ClassNotFoundException: getsp
	at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
Could not find the main class: getsp.  Program will exit.
./configure: line 50: test: -ge: unary operator expected
./configure: line 51: test: -eq: unary operator expected
RWeka needs at least Java version 1.5/5.0.
ERROR: configuration failed for package 'RWeka'
** Removing '/usr/lib/R/library/RWeka'

After surfing the web, I found a japanese/chinese(?) page with the same 
problem and I followed their advice (as I understood):

$ R CMD javareconf
Java interpreter : /usr/java/latest//jre/bin/java
Java version     : 1.6.0_10-rc2
Java home path   : /usr/java/latest/
Java compiler    : /usr/java/latest//bin/javac
Java headers gen.: /usr/java/latest//bin/javah
Java archive tool: /usr/java/latest//bin/jar
Java library path: 
/usr/java/jdk1.6.0_10/jre/lib/i386/server:/usr/java/jdk1.6.0_10/jre/lib/i386:/usr/java/jdk1.6.0_10/jre/../lib/i386::/usr/java/packages/lib/i386:/lib:/usr/lib
JNI linker flags : -L/usr/java/jdk1.6.0_10/jre/lib/i386/server 
-L/usr/java/jdk1.6.0_10/jre/lib/i386 
-L/usr/java/jdk1.6.0_10/jre/../lib/i386 -L -L/usr/java/packages/lib/i386 
-L/lib -L/usr/lib -ljvm
JNI cpp flags    : -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux

Updating Java configuration in /usr/lib/R
Done.

Then I tryed to repeat the $ R CMD INSTALL RWeka_0.3-14.tar.gz
but I received the previous error. What is wrong? Any help please?


Best regards,
-- 
Paulo Alexandre Ribeiro Cortez  (PhD, MSc)
Lecturer (Prof. Auxiliar) at the Department of Information Systems (DSI)
University of Minho, Campus de AzurÈm, 4800-058 Guimaraes, Portugal
http://www.dsi.uminho.pt/~pcortez +351253510313 Fax:+351253510300



More information about the R-help mailing list