--- old/test/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOptionsUtils.java 2015-06-17 19:52:16.636407566 +0300 +++ new/test/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOptionsUtils.java 2015-06-17 19:52:16.536407569 +0300 @@ -46,6 +46,23 @@ /* StringBuilder to accumulate failed message */ private static final StringBuilder finalFailedMessage = new StringBuilder(); + /* Used to start the JVM with the same type as current */ + static String VMType; + + static { + if (Platform.isServer()) { + VMType = "-server"; + } else if (Platform.isClient()) { + VMType = "-client"; + } else if (Platform.isMinimal()) { + VMType = "-minimal"; + } else if (Platform.isGraal()) { + VMType = "-graal"; + } else { + VMType = null; + } + } + /** * Add dependency for option depending on it's name. E.g. enable G1 GC for * G1 options or add prepend options to not hit constraints. @@ -330,11 +347,10 @@ if (additionalArgs.length > 0) { runJava.addAll(Arrays.asList(additionalArgs)); } - - if (Platform.isClient()) { - runJava.add("-client"); + + if (VMType != null) { + runJava.add(VMType); } - runJava.add(PRINT_FLAGS_RANGES); runJava.add("-version");