#include "jmsg.h"
+/* Shut up some errors in eclipse online compiler. I wish such a pimple wouldn't be needed */
+#ifndef JNIEXPORT
+#define JNIEXPORT
+#endif
+#ifndef JNICALL
+#define JNICALL
+#endif
+/* end of eclipse-mandated pimple */
+
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(jmsg);
static JavaVM *__java_vm = NULL;
if (!MSG_host_get_data(host)) { /* native host not associated yet with java host */
- /* instanciate a new java host */
+ /* Instantiate a new java host */
jhost = jhost_new_instance(env);
if (!jhost) {
argc = (int) (*env)->GetArrayLength(env, jargs);
argc++;
- argv = xbt_new0(char *, argc);
+ argv = xbt_new(char *, argc + 1);
argv[0] = strdup("java");
for (index = 0; index < argc - 1; index++) {
argv[index + 1] = strdup(tmp);
(*env)->ReleaseStringUTFChars(env, jval, tmp);
}
+ argv[argc] = NULL;
MSG_global_init(&argc, argv);