- process = MSG_process_create_with_environment(name,
- simgrid::java::java_main, jprocess,
- host,
- /*argc, argv, properties*/
- 0,NULL,NULL);
+ process = MSG_process_create_with_environment(name, [](int argc, char** argv) -> int {
+ smx_process_t process = SIMIX_process_self();
+ // This is the jprocess passed as environment.
+ // It would be simplet if we could use a closure.
+ jobject jprocess = (jobject) MSG_process_get_data(process);
+ simgrid::java::java_main_jprocess(jprocess);
+ return;
+ }, jprocess,
+ host,
+ /*argc, argv, properties*/
+ 0, nullptr, nullptr);