[BioC] Failed installing SJava on MacOS

Michael Dondrup Michael.Dondrup at uni.no
Thu Jan 21 16:44:20 CET 2010

this is just an update. After having it running on Linux, I thought I could debug around in the mac install, 
maybe it helps to isolate the problem. here is what I tried so far to rule out any simple error:

-- First question: where does the error message come from?

function is isRReference in RReferenceCall.c:

/* #line 378 "RReferenceCall.cweb" */
isRReference(jobject obj, JNIEnv *env)
    jclass klass;
    jboolean ans;
    klass = VMENV FindClass(env, "org/omegahat/R/Java/RForeignReference");
    if(!klass) {
        PROBLEM "Can't find org.omegahat.R.Java.RForeignReference"
    ans = VMENV IsInstanceOf(env, obj, klass);
//XX Do we need to release this klass.


conclusion: FindClass does not find it.
(So I would like to inspect the "env" variable, but don't know how to do this.)

-- Then, where is that class org.omegahat.R.Java.RForeignReference?
This class is compiled from /SJava/inst/org/omegahat/R/Java/RForeignReference.java and installed to
Does it contain the class? Yes:

$ javap -classpath . RForeignReference
Compiled from "RForeignReference.java"
public class org.omegahat.R.Java.RForeignReference extends org.omegahat.Interfaces.NativeInterface.ForeignReference{
    static boolean LoadLibrary;
    public org.omegahat.R.Java.RForeignReference(java.lang.String);
    public org.omegahat.R.Java.RForeignReference(java.lang.String, org.omegahat.Interfaces.NativeInterface.OmegaInterfaceManager);
    public org.omegahat.R.Java.RForeignReference(org.omegahat.Interfaces.NativeInterface.ForeignReference);
    public org.omegahat.R.Java.RForeignReference(org.omegahat.Interfaces.NativeInterface.ForeignReference, org.omegahat.Interfaces.NativeInterface.OmegaInterfaceManager);
    public java.lang.Object localEval(org.omegahat.Environment.Parser.Parse.List, java.lang.String, java.lang.String, java.lang.String[])       throws java.lang.Exception;
    public native java.lang.Object reval(java.lang.String, java.lang.Object[], java.lang.String, java.lang.String, java.lang.String[]);
    static {};

-- Is it on the classpath? Add this path explicitly to  $CLASSPATH and set it during .JavaInit and turned on verbose=T:
Didn't work, looks as if the classpath setting is ignored.

> .JavaInit(default=javaConfig(classPath=c("/Library/Frameworks/R.framework/Versions/2.10/Resources/library/SJava/org/omegahat/R/Java/", javaConfig()@classPath)), verbose=T)
An object of class "JavaConfiguration"
Slot "classPath":
[1] "/Library/Frameworks/R.framework/Versions/2.10/Resources/library/SJava/org/omegahat/R/Java/:/Library/Frameworks/R.framework/Resources/library/SJava/org/omegahat/Jars/Environment.jar:/Library/Frameworks/R.framework/Resources/library/SJava/org/..:/Library/Frameworks/R.framework/Resources/library/SJava/org/omegahat/Jars/antlr.jar:/Library/Frameworks/R.framework/Resources/library/SJava/org/omegahat/Jars/jas.jar:/Library/Frameworks/R.framework/Resources/library/SJava/org/omegahat/Jars/jhall.jar"

Slot "libraryPath":
[1] "/Library/Frameworks/R.framework/Resources/library/SJava/libs"

Slot "properties":
[1] "-DEmbeddedInR=true"                                                                             
[2] "-DInterfaceManagerClass=org/omegahat/Interfaces/NativeInterface/OmegaInterfaceManager"          
[3] "-DForeignReferenceBaseClass=org/omegahat/R/Java/RJavaInstance"                                  
[4] "-Djava.compiler=NONE"                                                                           
[5] "-DOMEGA_HOME=/Library/Frameworks/R.framework/Resources/library/SJava/org/omegahat"              
[6] "-DOmegahatSearchPath=.,${OMEGA_HOME}/Environment/Scripts/Run,${OMEGA_HOME}/Jars/Environment.jar"
[7] "-Djava.library.path=/Library/Frameworks/R.framework/Resources/library/SJava/libs"               

Slot "options":

Slot "args":

Got it

> example(.Java)
Error in .Java(v, "add", "A string element") : 
  Can't find org.omegahat.R.Java.RForeignReference

-- Put all classes into a jar file and added the jar file to the class path in .JavaInit
Didn't work. 

So I'm giving up for now. Would really like to have this work and in principle it should, but something seems to be very odd on the mac :(

Thank you again, and sorry for this lengthy email.


Am Jan 19, 2010 um 6:37 PM schrieb Seth Falcon:

> On 1/19/10 8:58 AM, Martin Morgan wrote:
>> Michael Dondrup wrote:
>>> Am Jan 19, 2010 um 3:39 PM schrieb Martin Morgan:
>>>> Michael Dondrup wrote:
>>>>> Hi,
>>>>> I would like to use RWebServices and therefore SJava on Mac OS snow leopard. The documentation does not explicitly mention Mac os, so it's
>>>>> maybe not supported, but i hope it can be made working anyway.
>>>>> Maybe somebody out there got this configuration running and could help? I am trying to install SJava 0.72. I try the following:
>>>>>> library(SJava)
>>>>> Load the Java VM with .JavaInit()
>>>>>> .JavaInit()
>>>>>> example(.Java)
>>>>> .Java>    v<- .JavaConstructor("java.util.Vector", as.integer(10))
>>>>> .Java>   .Java(v, "add", "A string element")
>>>>> Error in .Java(v, "add", "A string element") :
>>>>>  Can't find org.omegahat.R.Java.RForeignReference
>> this is in org.omegahat/Jars/RJava.jar, e.g.,
>>   jar tf org.omegahat/Jars/RJava.jar
> Curious, as this jar did not appear on your classpath in your previous mail.
> I'm able to reproduce the error on my Snow Leopard laptop.  I also notice that I don't have this jar.  There are .class files under the package structure in org/omegahat/R/Java/*.class. RForeignReference.class is among them and this would seem to be the purpose of the "<...>/SJava/org/.." entry in class path.
>> more below...
>>> Here is the output of javaConfig().
>>>> javaConfig()
>>> An object of class "JavaConfiguration"
>>> Slot "classPath":
>>> [1] "/Library/Frameworks/R.framework/Resources/library/SJava/org/omegahat/Jars/Environment.jar"
>>> [2] "/Library/Frameworks/R.framework/Resources/library/SJava/org/.."
>>> [3] "/Library/Frameworks/R.framework/Resources/library/SJava/org/omegahat/Jars/antlr.jar"
>>> [4] "/Library/Frameworks/R.framework/Resources/library/SJava/org/omegahat/Jars/jas.jar"
>>> [5] "/Library/Frameworks/R.framework/Resources/library/SJava/org/omegahat/Jars/jhall.jar"
>>> Slot "libraryPath":
>>> [1] "/Library/Frameworks/R.framework/Resources/library/SJava/libs"
>>> Slot "properties":
>>>                                                                  EmbeddedInR
>>>                                                                       "true"
>>>                                                        InterfaceManagerClass
>>>              "org/omegahat/Interfaces/NativeInterface/OmegaInterfaceManager"
>>>                                                    ForeignReferenceBaseClass
>>>                                          "org/omegahat/R/Java/RJavaInstance"
>>>                                                                java.compiler
>>>                                                                       "NONE"
>>>                                                                   OMEGA_HOME
>>>       "/Library/Frameworks/R.framework/Resources/library/SJava/org/omegahat"
>>>                                                           OmegahatSearchPath
>>> ".,${OMEGA_HOME}/Environment/Scripts/Run,${OMEGA_HOME}/Jars/Environment.jar"
>> My javaConfig() (not on Mac) has ${OMEGA_HOME} expanded
> Mine is not expanded.  I tried expanding it, but that didn't seem to make a difference either. :-(
> -- 
> Seth Falcon
> Bioconductor Core Team | FHCRC
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor

More information about the Bioconductor mailing list