Daer all, Before to expose my problem, this the configuartion of my environment. I use the version 1.2.1 of R with a limux system (redhat) I have installed SJava (from omeghat) package successfully. So, i wanted to try an example (calc.R) that is provided in the library. This is the message I obtained: Error in isJavaInitialized("Java virtual machine has not been initialized. Call .JavaInit Java virtual machine has not been initialized. Call .JavaInit() So, i tried .JavaInit() but i obtained Segmentation fault (core dumped) Could somebody help me ? Thanks, Olivier -- -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- Olivier MARTIN PhD student phone: (33) 04 76 61 53 55 Projet IS2 06 08 67 93 42 INRIA Rhone-Alpes fax : (33) 04 76 61 54 77 655, Av. de l'Europe Montbonnot e-mail:olivier.martin at inrialpes.fr 38334 Saint Ismier cedex -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- -------------- next part -------------- An HTML attachment was scrubbed... URL: https://stat.ethz.ch/pipermail/r-help/attachments/20011002/93ed4229/attachment.html
Olivier Martin wrote:> Daer all, > > Before to expose my problem, this the configuartion of my environment. > > I use the version 1.2.1 of R with a limux system (redhat) > > I have installed SJava (from omeghat) package successfully. > So, i wanted to try an example (calc.R) that is provided in the > library. > This is the message I obtained: > Error in isJavaInitialized("Java virtual machine has not been > initialized. Call .JavaInit > Java virtual machine has not been initialized. Call .JavaInit() > > So, i tried .JavaInit() but i obtained Segmentation fault (core > dumped) > > Could somebody help me ? > Thanks, > Olivier > > -- > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > Olivier MARTIN > PhD student phone: (33) 04 76 61 53 55 > Projet IS2 06 08 67 93 42 > INRIA Rhone-Alpes fax : (33) 04 76 61 54 77 > 655, Av. de l'Europe > Montbonnot e-mail:olivier.martin at inrialpes.fr > 38334 Saint Ismier cedex > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > >I finally got it running (sorta) on my RH7.1. I would make sure you have the latest package from Omegahat first. Then, I believe the most likely culprit is the LD_LIBRARY_PATH env variable. Mine includes the following (my bash profile). LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib/R/library/SJava/libs:/opt/IBMJava2-13/jre/bin: /opt/IBMJava2-13/jre/bin/classic:/usr/lib:/usr/local/lib/R/bin:/usr/local/lib/R/library/SJava/org/omegahat/Jars/ROmegahatExamples.jar:.; export LD_LIBRARY_PATH You can replace the java directories with the jdk you are using. Also make sure that error messages aren't pointing you to a '.so' (in the libs directory of SJava) that you don't have. I had to rename one of them in an earlier version of the SJava package. Even with this, I am only able to run an example after I run java at least once. I would open the BASH shell and run any java class and then open R and be able to run the examples ( library(SJava);.JavaInit();source(....example.r);example.r(); ) . This makes it a little difficult to use the package (or at the least, inelegant) by running R in batch. I have had a lot of difficulty creating any original code with this package. My goal was to create some original code to allow me to run a java app that called R. Not much luck. I put a message out some time ago but I haven't had much luck getting responses. If anyone out there has had any luck using this package with Redhat and IBM JDK please let me know. Hope this helps. For the future, the omegahat help list would probably be a better place to put this. Although I realize that list doesn't get nearly as much feedback as this one. -- Andrew Schuh Environmental Mathematician Neptune and Co, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: https://stat.ethz.ch/pipermail/r-help/attachments/20011002/5618bdd2/attachment.html
Hi Olivier. For (what I believe are) technical reasons, if you get an error in R before initializing the Java virtual machine (JVM), very bad things happen when you do actually start Java via the .JavaInit() function. So the thing to try is running R, and immediately loading the SJava library and initializing the JVM. (R > library(SJava) > .JavaInit() ) Then things should be better and we can start dealing with any other problems. The technical reasons that I believe are causing the problem are what make the S-Java connection somewhat less stable than other packages. Specifically they relate to the fact that Java and the underlying implementation uses threads, while R does not. And all the libraries that they share in common (libc, libm, ...) are slightly different and whoever gets to load them first wins and sets the environment for the other. When running Java inside R, R wins. On Unix, you can run Java and call R from within Java. In that setup, Java will load the correct libraries for itself and R will be happy with the result. As Andrew pointed out, setting the LD_LIBRARY_PATH environment variable correctly is important. And ensuring that the same JVM is used at run time as used at compile time is usually vital. To to do this, the package supplies two shell scripts (one for the C shell and another for the Bourne shell) in the scripts/ directory which can be sourced to set the necessary environment variables. Hope this helps. I'm keen to hear about other problems. D. Olivier Martin wrote:> Daer all, > > Before to expose my problem, this the configuartion of my environment. > I use the version 1.2.1 of R with a limux system (redhat) > > I have installed SJava (from omeghat) package successfully. > So, i wanted to try an example (calc.R) that is provided in the library. > > This is the message I obtained: > Error in isJavaInitialized("Java virtual machine has not been > initialized. Call .JavaInit > Java virtual machine has not been initialized. Call .JavaInit() > > So, i tried .JavaInit() but i obtained Segmentation fault (core dumped) > > Could somebody help me ? > Thanks, > Olivier > > -- > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > Olivier MARTIN > PhD student phone: (33) 04 76 61 53 55 > Projet IS2 06 08 67 93 42 > INRIA Rhone-Alpes fax : (33) 04 76 61 54 77 > 655, Av. de l'Europe > Montbonnot e-mail:olivier.martin at inrialpes.fr > 38334 Saint Ismier cedex > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > >-- _______________________________________________________________ Duncan Temple Lang duncan at research.bell-labs.com Bell Labs, Lucent Technologies office: (908)582-3217 700 Mountain Avenue, Room 2C-259 fax: (908)582-3340 Murray Hill, NJ 07974-2070 http://cm.bell-labs.com/stat/duncan -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._