Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4146712

New JVM options setting structure - classpath ignored

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.2.0
    • hotspot
    • x86
    • windows_nt



      Name: rm29839 Date: 06/08/98


      I've tried to use mechanism of setting JVM
      options, introduced with JDK1.2. Unfortunately,
      it looks like "classpath" option is ignored.

      Below is source code. JDK1.1 options setting
      affects classpath, while JDK1.2 does not.

      #ifdef JDK1_2
        {
          JavaVMOption options[2];

          options[0].name = "classpath";
          options[0].value.p = ".;c:\\jdk1.2beta3\\lib\\classes.zip";
          
          options[1].name = "verbose";
          options[1].value.p = "class";
          
          vm_args.version = 0x00010002;
          vm_args.options = options;
          vm_args.nOptions = sizeof(options)/sizeof(options[0]);
          vm_args.result = NULL;
          
          res = JNI_CreateJavaVM(&jvm, (void **) &env, &vm_args);
        }
      #else


        vm_args.version = 0x00010001; /* New in 1.1.2: VM version */
        /* Get the default initialization arguments and set the class
         * path */

        JNI_GetDefaultJavaVMInitArgs(&vm_args);

        newClassPath = (char *)malloc(strlen(vm_args.classpath)+strlen(".;")+1);
        strcpy(newClassPath,".;");
        strcat(newClassPath,vm_args.classpath);
        vm_args.classpath = newClassPath;


        
        /* load and initialize a Java VM, return a JNI interface
         * pointer in env */
        res = JNI_CreateJavaVM(&jvm, (void **)&env, &vm_args);
      #endif
      (Review ID: 33052)
      ======================================================================

            sliangsunw Sheng Liang (Inactive)
            rmandelsunw Ronan Mandel (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: