This is the mail archive of the java-prs@sourceware.cygnus.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

libgcj/279: fail to call JNI_CreateJavaVM()



>Number:         279
>Category:       libgcj
>Synopsis:       fail to call JNI_CreateJavaVM()
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    tromey
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 05 14:40:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     a1tv86@yahoo.com
>Release:        libgcj-snapshot-2000-06-20
>Organization:
>Environment:
Solaris 2.6
>Description:
Build the libgcj with option --enable-threads=none
Compile the following simple program:
----------------------
#include <iostream.h>

#include <jni.h>

int main(int argc, char* argv[])
{
  int nError = 0;
  JavaVMInitArgs sArgs;
  JavaVMOption sOptions[2];
  JavaVM *psMachine = (JavaVM *)0;
  void *pvEnv = (void *)0;

  sArgs.version = JNI_VERSION_1_2;
  JNI_GetDefaultJavaVMInitArgs(&sArgs);

  sOptions[0].optionString = "-Djava.compiler=NONE";
  sOptions[0].optionString = "-Djava.class.path=.:/usr/local/lib";

  nError = JNI_CreateJavaVM(&psMachine, &pvEnv, &sArgs);
  if (nError < 0)
  {
    cout << "Error: ";
    cout << nError;
    cout << " - JNI_CreateJavaVM()\n";
  } /* if */
  else
  {
  } /* else */

  return 0;
} /* main */
--------------------
Build the executable.
Run the executable, get an error when call JNI_CreateJavaVM().
Step through gdb, _Jv_JNI_AttachCurrentThread() returns NULL.

>How-To-Repeat:
see description.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]