[R] SJava, another UnsatisfiedLinkError

Pauline Gu gu4 at llnl.gov
Thu Aug 15 20:20:55 CEST 2002


Thanks for Professor Ripley and Brad's reply.

UnsatisfiedLinkError: SJava.dll is gone.  But, I have another problem.  I 
have been trying to figure out, but, without success.

Here is my test.java:
import java.io.*;
import org.omegahat.R.Java.REvaluator;


public class test {
     public static void main(String args[]) {
         System.out.println("Hello...");
         org.omegahat.R.Java.REvaluator e = new REvaluator();
         Object val = e.eval("objects()");

         if (val != null) {
         String[] objects = (String[])val;
         for (int i=0; i < objects.length; i++) {
             System.err.println("("+i+") " + objects[i]);
         }
       }
     }
}

And here is my callR.win:

#!sh

# If the caller gives a class name, use that.
# Otherwise, we will look for the environment variable JCLASS
# or use the JavaRCall example

if test -n "$1" ; then
  JCLASS=$1
fi

JCLASS=${JCLASS-org.omegahat.R.Java.Examples.JavaRCall}

# Ensure R_HOME is set and available to Java.
#R_HOME=${R_HOME-/cygwin/home/duncan/Projects/R-1.3.1}
#export R_HOME

# Ensure that we can find SJava.dll and RInterpreter.dll
export PATH="${PATH}:${R_HOME}/library/SJava/libs:${R_HOME}/bin"
#echo ${PATH}

# Now the classpath for the Omegahat and related Jar files, etc.
JAR_DIR=${R_HOME}/library/SJava/org/omegahat/Jars

CLASSPATH=".;${R_HOME}/library/SJava;${JAR_DIR}/antlr.jar;${JAR_DIR}/Environment.jar;${JAR_DIR}/jas.jar;${JAR_DIR}/ROmegahatExamples.jar"

# We are ready
#java -classpath ${CLASSPATH} ${JCLASS}

#echo "javac -classpath ${CLASSPATH} bla.java"

javac -classpath ${CLASSPATH} test.java
java -classpath ${CLASSPATH} test

And here is my error message:
Hello...
Exception in thread "main" java.lang.UnsatisfiedLinkError: eval
         at org.omegahat.R.Java.REvaluator.eval(Native Method)
         at org.omegahat.R.Java.REvaluator.eval(REvaluator.java:86)
         at org.omegahat.R.Java.REvaluator.eval(REvaluator.java:36)
         at test.main(test.java:9)

Note: I have tried test.java with the REvaluator's call function, 
ROmegahatInterpreter's constructor function.  They all gave me the same 
message:
UnsatisfiedLinkError: call
UnsatisfiedLinkError: initR

I suspect the native functions in R is not working correctly from 
Java.  Can anyone give me some hint?

Thanks for your time.

Pauline

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list