1 Reply Latest reply: Apr 6, 2010 10:08 AM by 843802 RSS

    libnpjp2.so cannot found the JVM

    843802
      Hi,
      I am trying to use the new javaplugin (libnpj2.so) with my application,
      which is based on XULRunner 1.9.1, and thus can run standard netscape/firefox plugins.

      First I put the plugin in the "plugins/" directory of my application (lets call it /home/me/foo)
      then tried to start the application : the plugin loads!
      but a few seconds after, I got this error message:
      Didn't find JVM under /home/me/foo/plugins
      xulrunner-stub: ../../../../src/plugin/solaris/plugin2/common/JavaVM.c:104: InitializeJVM: Assertion `foundJVM' failed.
      I conclude it cannot find any JVM, neither in the system (I have multiple JREs in my system, but only use is used by default, of course)
      or in my "/home/me/foo/plugins" (why does it try to load it from there?).

      Since I also wish to bundle the JRE with my application,
      I put a JRE (I took the Processing project as an example of standalone java application) in a "java" directory, along with my application.

      Then, using a shell script (not very nice, I admit it), I tried to set the environment variables before starting the application like :
      export JAVA_HOME=`pwd`/java
      export PATH=`pwd`/java
      # run the app
      along with subtle variations (/java/bin, /java/bin/java..), with no success.

      In last resort, I also tried to edit the xulrunner app config file (it's in javascript), with something like this :
      pref("java.default_java_location_others","/home/me/foo/java"); 
      // of course this would only work on my computer, but I maybe I could use a JS/mozilla platform variable here to get the absolute path
      with no more success.


      Thanks in advance, I you got any hint to tell the plugin where to find a JVM!

      regards, Julian

      Edited by: jbilcke on Apr 6, 2010 4:03 PM
        • 1. Re: libnpjp2.so cannot found the JVM
          843802
          I think I found an explanation. The libnpjp2.so library seems to search its dependencies in the parent directories

          so it looks compulsory to create a link
          cd /home/me/foo
          ln -s `pwd`/java/lib/amd64/libnpjp2.so plugins/libnpjp2.so
          I still need to figure out how achieve the same procedure under Windows, though.

          Edited by: jbilcke on Apr 6, 2010 5:07 PM