Changeset 352 for trunk


Ignore:
Timestamp:
Mar 1, 2012, 11:37:37 AM (13 years ago)
Author:
djay
Message:

Small modification in classpath handling.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-project/zoo-kernel/service_internal_java.c

    r348 r352  
    3535  char oclasspath[2068];
    3636  int res=SERVICE_FAILED;
     37  char *cclasspath=getenv("CLASSPATH");
    3738  if(tmp!=NULL){
    38     sprintf(classpath,"%s/%s/:$CLASSPATH",ntmp,tmp->value);
    39     sprintf(oclasspath,"-Djava.class.path=%s/%s",ntmp,tmp->value);
     39    if(cclasspath!=NULL)
     40      sprintf(classpath,"%s/%s/:%s",ntmp,tmp->value,cclasspath);
     41    else
     42      sprintf(classpath,"%s/%s/",ntmp,tmp->value);
     43    sprintf(oclasspath,"-Djava.class.path=%s",classpath);
    4044  }
    4145  else{
    42     sprintf(classpath,"%s:$CLASSPATH",ntmp);
    43     sprintf(oclasspath,"-Djava.class.path=%s",ntmp);
     46    if(cclasspath!=NULL)
     47      sprintf(classpath,"%s:%s",ntmp,cclasspath);
     48    else
     49      sprintf(classpath,"%s/%s/",ntmp,tmp->value);
     50    sprintf(oclasspath,"-Djava.class.path=%s",classpath);
    4451  }
    4552#ifdef DEBUG
     
    5966  int i;
    6067
    61   options[0].optionString = oclasspath;
    62 
    63   vm_args.version = JNI_VERSION_1_2;
     68  options[0].optionString = strdup(oclasspath);
     69
    6470  JNI_GetDefaultJavaVMInitArgs(&vm_args);
     71  vm_args.version = JNI_VERSION_1_6;
    6572  vm_args.options = options;
    6673  vm_args.nOptions = 1;
     
    8996    free(err);
    9097    (*jvm)->DestroyJavaVM(jvm);
    91     return 1;
     98    return -1;
    9299  }
    93100#ifdef DEBUG
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png