Skip to content

RJava question(class not found with rJava's vm, though found with alternate vm)

3 messages · Simon Urbanek, Saptarshi Guha

#
On Apr 5, 2009, at 9:26 AM, Saptarshi Guha wrote:

            
The correct mailing list is stats-rosuda-devel:
http://mailman.rz.uni-augsburg.de/mailman/listinfo/stats-rosuda-devel

(The rJava mailing list was a test but it turned out that everyone is  
still using stats-rosuda-devel so the idea of a separate list was  
abandoned).
Can you, please, send me the exact code you're using? (I.e. exactly  
the value of CLASSPATH, your platform, how you started R and  
initialized rJava and what you tried to do to load the class).

A side note - preferably you should not be using the CLASSPATH  
environment variable, because that is very limited and doesn't work if  
you have multiple packages using Java. Instead use .jinit or .jpackage  
(under the hood CLASSPATH gets converted but that is for compatibility  
only).
No, more likely that your code is using the wrong class loader for  
loading files. The code below sets the path in the system class loader  
but that is not the loader used by R code. Since R needs to modify the  
class path on the fly (as packages are loaded) it uses its own class  
loader. It seems as if you are bypassing that loader and thus running  
into problems (without exact details we can't tell for sure).

Cheers,
Simon