+ /* build the C name of the process */
+ name = (*env)->GetStringUTFChars(env, jname, 0);
+ name = xbt_strdup(name);
+
+ /* Retrieve the kill time from the process */
+ jdouble jkill = (*env)->GetDoubleField(env, jprocess, jprocess_field_Process_killTime);
+ /* Actually build the MSG process */
+ process = MSG_process_create_with_environment(name,
+ (xbt_main_func_t) jprocess,
+ /*data*/ jprocess,
+ host,
+ /*argc, argv, properties*/
+ 0,NULL,NULL);
+ MSG_process_set_kill_time(process, (double)jkill);
+ MSG_process_set_data(process,&process);
+ /* bind the java process instance to the native process */
+ jprocess_bind(jprocess, process, env);
+
+ /* release our reference to the process name (variable name becomes invalid) */
+ //FIXME : This line should be uncommented but with mac it doesn't work. BIG WARNING
+ //(*env)->ReleaseStringUTFChars(env, jname, name);
+ (*env)->ReleaseStringUTFChars(env, jhostname, hostname);
+
+ /* sets the PID and the PPID of the process */
+ (*env)->SetIntField(env, jprocess, jprocess_field_Process_pid,(jint) MSG_process_get_PID(process));
+ (*env)->SetIntField(env, jprocess, jprocess_field_Process_ppid, (jint) MSG_process_get_PPID(process));
+ /* sets the Host of the process */
+ jobject jhost = Java_org_simgrid_msg_Host_getByName(env,NULL,jhostname);
+
+ (*env)->SetObjectField(env, jprocess, jprocess_field_Process_host, jhost);