--- old/src/hotspot/share/runtime/arguments.cpp 2018-01-24 16:40:45.395085323 +0530 +++ new/src/hotspot/share/runtime/arguments.cpp 2018-01-24 16:40:45.191084034 +0530 @@ -3211,6 +3211,20 @@ "ManagementServer is not supported in this VM.\n"); return JNI_ERR; #endif // INCLUDE_MANAGEMENT + } else if (match_option(option, "-Xmanagement", &tail)) { +#if INCLUDE_MANAGEMENT + if (FLAG_SET_CMDLINE(bool, ManagementServer, true) != Flag::SUCCESS) { + return JNI_EINVAL; + } + // management agent in module jdk.management.agent + if (!create_numbered_property("jdk.module.addmods", "jdk.management.agent", addmods_count++)) { + return JNI_ENOMEM; + } +#else + jio_fprintf(defaultStream::output_stream(), + "-Xmanagement is not supported in this VM.\n"); + return JNI_ERR; +#endif } else if (match_option(option, "-XX:", &tail)) { // -XX:xxxx // Skip -XX:Flags= and -XX:VMOptionsFile= since those cases have // already been handled