8136930: Simplify use of module-system options by custom launchers
authormchung
Wed, 10 Aug 2016 15:51:25 -0700
changeset 40261 86a49ba76f52
parent 40260 4e69b50ccd97
child 40262 1b3dd37cb96d
8136930: Simplify use of module-system options by custom launchers Reviewed-by: alanb, ksrini, henryjen, sundar
jdk/make/GenerateModuleSummary.gmk
jdk/make/ModuleTools.gmk
jdk/make/Tools.gmk
jdk/make/gendata/GendataBreakIterator.gmk
jdk/make/launcher/Launcher-java.desktop.gmk
jdk/make/launcher/Launcher-java.scripting.gmk
jdk/make/launcher/Launcher-jdk.compiler.gmk
jdk/make/launcher/Launcher-jdk.javadoc.gmk
jdk/make/launcher/Launcher-jdk.jlink.gmk
jdk/make/launcher/Launcher-jdk.scripting.nashorn.shell.gmk
jdk/make/src/classes/build/tools/jigsaw/ModuleSummary.java
jdk/src/java.base/share/classes/java/lang/System.java
jdk/src/java.base/share/classes/java/lang/module/ModuleReference.java
jdk/src/java.base/share/classes/java/lang/module/ModuleReferences.java
jdk/src/java.base/share/classes/java/lang/module/SystemModuleFinder.java
jdk/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java
jdk/src/java.base/share/classes/jdk/internal/module/ModulePatcher.java
jdk/src/java.base/share/classes/sun/launcher/LauncherHelper.java
jdk/src/java.base/share/classes/sun/launcher/resources/launcher.properties
jdk/src/java.base/share/native/libjli/args.c
jdk/src/java.base/share/native/libjli/java.c
jdk/src/java.base/share/native/libjli/java.h
jdk/src/jdk.jartool/share/classes/sun/tools/jar/GNUStyleOptions.java
jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar.properties
jdk/src/jdk.jlink/share/classes/jdk/tools/jimage/JImageTask.java
jdk/src/jdk.jlink/share/classes/jdk/tools/jimage/resources/jimage.properties
jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java
jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java
jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink.properties
jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/plugins.properties
jdk/src/jdk.jlink/share/classes/jdk/tools/jmod/JmodTask.java
jdk/src/jdk.jlink/share/classes/jdk/tools/jmod/resources/jmod.properties
jdk/test/ProblemList.txt
jdk/test/TEST.ROOT
jdk/test/com/sun/corba/5036554/TestCorbaBug.sh
jdk/test/com/sun/corba/7130985/CorbaExceptionsCompileTest.java
jdk/test/com/sun/corba/se/impl/io/HookPutFieldsTest.java
jdk/test/com/sun/corba/se/impl/orb/SetDefaultORBTest.java
jdk/test/com/sun/jdi/ImmutableResourceTest.sh
jdk/test/com/sun/jndi/cosnaming/CNNameParser.java
jdk/test/com/sun/jndi/cosnaming/IiopUrlIPv6.java
jdk/test/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java
jdk/test/java/awt/Gtk/GtkVersionTest/GtkVersionTest.java
jdk/test/java/awt/Toolkit/Headless/WrappedToolkitTest/WrappedToolkitTest.sh
jdk/test/java/awt/xembed/server/RunTestXEmbed.java
jdk/test/java/awt/xembed/server/TestXEmbedServerJava.java
jdk/test/java/beans/XMLDecoder/8028054/TestConstructorFinder.java
jdk/test/java/beans/XMLDecoder/8028054/TestMethodFinder.java
jdk/test/java/lang/Class/forName/modules/TestDriver.java
jdk/test/java/lang/Class/getDeclaredField/FieldSetAccessibleTest.java
jdk/test/java/lang/Class/getResource/ResourcesTest.java
jdk/test/java/lang/ClassLoader/getResource/modules/ResourcesTest.java
jdk/test/java/lang/SecurityManager/modules/CustomSecurityManager.sh
jdk/test/java/lang/String/concat/WithSecurityManager.java
jdk/test/java/lang/instrument/MakeJAR2.sh
jdk/test/java/lang/invoke/modules/ModuleAccessControlTest.java
jdk/test/java/lang/reflect/Layer/LayerAndLoadersTest.java
jdk/test/java/lang/reflect/Layer/src/m1/module-info.java
jdk/test/java/lang/reflect/Module/AddExportsTest.java
jdk/test/java/lang/reflect/Module/access/AccessTest.java
jdk/test/java/lang/reflect/Proxy/ProxyClassAccessTest.java
jdk/test/java/lang/reflect/Proxy/ProxyLayerTest.java
jdk/test/java/lang/reflect/Proxy/ProxyModuleMapping.java
jdk/test/java/lang/reflect/Proxy/ProxyTest.java
jdk/test/java/net/Authenticator/B4933582.sh
jdk/test/java/net/SocketOption/OptionsTest.java
jdk/test/java/net/SocketOption/UnsupportedOptionsTest.java
jdk/test/java/net/httpclient/http2/HpackDriver.java
jdk/test/java/nio/channels/DatagramChannel/SocketOptionTests.java
jdk/test/java/nio/channels/ServerSocketChannel/SocketOptionTests.java
jdk/test/java/nio/channels/SocketChannel/SocketOptionTests.java
jdk/test/java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh
jdk/test/java/rmi/activation/Activatable/extLoadedImpl/ext.sh
jdk/test/java/rmi/activation/ActivationGroup/downloadActivationGroup/DownloadActivationGroup.java
jdk/test/java/rmi/activation/ActivationSystem/stubClassesPermitted/StubClassesPermitted.java
jdk/test/java/rmi/activation/rmidViaInheritedChannel/InheritedChannelNotServerSocket.java
jdk/test/java/rmi/activation/rmidViaInheritedChannel/RmidViaInheritedChannel.java
jdk/test/java/rmi/module/ModuleTest.java
jdk/test/java/rmi/registry/readTest/readTest.sh
jdk/test/java/rmi/transport/checkFQDN/CheckFQDN.java
jdk/test/java/rmi/transport/dgcDeadLock/DGCDeadLock.java
jdk/test/java/security/Provider/SecurityProviderModularTest.java
jdk/test/java/security/modules/ModularTest.java
jdk/test/java/security/testlibrary/Proc.java
jdk/test/java/util/Calendar/GenericTimeZoneNamesTest.sh
jdk/test/java/util/Formatter/Basic.sh
jdk/test/java/util/Locale/LocaleProviders.sh
jdk/test/java/util/PluggableLocale/ExecTest.sh
jdk/test/java/util/ResourceBundle/Bug6299235Test.sh
jdk/test/java/util/ResourceBundle/modules/appbasic/appbasic.sh
jdk/test/java/util/ResourceBundle/modules/appbasic2/appbasic2.sh
jdk/test/java/util/ResourceBundle/modules/basic/basic.sh
jdk/test/java/util/ResourceBundle/modules/modlocal/modlocal.sh
jdk/test/java/util/ResourceBundle/modules/security/TestPermission.java
jdk/test/java/util/ResourceBundle/modules/simple/simple.sh
jdk/test/java/util/ResourceBundle/modules/visibility/visibility.sh
jdk/test/java/util/ResourceBundle/modules/xmlformat/xmlformat.sh
jdk/test/java/util/ServiceLoader/modules/ServicesTest.java
jdk/test/java/util/logging/modules/GetResourceBundleTest.java
jdk/test/javax/crypto/Cipher/CipherStreamClose.java
jdk/test/javax/imageio/plugins/external_plugin_tests/TestClassPathPlugin.sh
jdk/test/javax/imageio/stream/StreamCloserLeak/run_test.sh
jdk/test/javax/naming/module/basic.sh
jdk/test/javax/rmi/PortableRemoteObject/8146975/RmiIiopReturnValueTest.java
jdk/test/javax/rmi/PortableRemoteObject/ConcurrentHashMapTest.java
jdk/test/javax/security/auth/login/modules/JaasModularClientTest.java
jdk/test/javax/security/auth/login/modules/JaasModularDefaultHandlerTest.java
jdk/test/javax/smartcardio/CommandAPDUTest.java
jdk/test/javax/smartcardio/HistoricalBytes.java
jdk/test/javax/smartcardio/ResponseAPDUTest.java
jdk/test/javax/smartcardio/Serialize.java
jdk/test/javax/smartcardio/TerminalFactorySpiTest.java
jdk/test/javax/smartcardio/TestCardPermission.java
jdk/test/javax/smartcardio/TestCommandAPDU.java
jdk/test/javax/transaction/testng/Driver.java
jdk/test/javax/xml/bind/JAXBContext/JAXBContextWithAbstractFactory.java
jdk/test/javax/xml/bind/JAXBContext/JAXBContextWithLegacyFactory.java
jdk/test/javax/xml/bind/JAXBContext/JAXBContextWithSubclassedFactory.java
jdk/test/javax/xml/bind/jxc/8073872/SchemagenStackOverflow.java
jdk/test/javax/xml/bind/marshal/8134111/UnmarshalTest.java
jdk/test/javax/xml/bind/xjc/8032884/XjcOptionalPropertyTest.java
jdk/test/javax/xml/bind/xjc/8145039/JaxbMarshallTest.java
jdk/test/javax/xml/jaxp/common/8035437/run.sh
jdk/test/javax/xml/soap/XmlTest.java
jdk/test/javax/xml/soap/spi/SAAJFactoryTest.java
jdk/test/javax/xml/ws/8043129/MailTest.java
jdk/test/javax/xml/ws/clientjar/TestWsImport.java
jdk/test/javax/xml/ws/publish/WSTest.java
jdk/test/javax/xml/ws/xsanymixed/Test.java
jdk/test/jdk/internal/misc/VM/RuntimeArguments.java
jdk/test/jdk/internal/reflect/Reflection/GetCallerClassTest.sh
jdk/test/jdk/modules/etc/VerifyModuleDelegation.java
jdk/test/jdk/modules/scenarios/automaticmodules/RunWithAutomaticModules.java
jdk/test/jdk/modules/scenarios/container/ContainerTest.java
jdk/test/jdk/modules/scenarios/overlappingpackages/OverlappingPackagesTest.java
jdk/test/sun/awt/shell/ShellFolderMemoryLeak.java
jdk/test/sun/management/jmxremote/bootstrap/CustomLauncherTest.java
jdk/test/sun/management/jmxremote/bootstrap/LocalManagementTest.java
jdk/test/sun/management/jmxremote/bootstrap/RmiBootstrapTest.sh
jdk/test/sun/management/jmxremote/bootstrap/RmiSslBootstrapTest.sh
jdk/test/sun/management/jmxremote/bootstrap/RmiSslNoKeyStoreTest.sh
jdk/test/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxy.sh
jdk/test/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxyWithAuth.sh
jdk/test/sun/net/www/protocol/jrt/OtherResources.java
jdk/test/sun/net/www/protocol/jrt/other_resources.sh
jdk/test/sun/rmi/rmic/iiopCompilation/IIOPCompilation.java
jdk/test/sun/rmi/runtime/Log/6409194/NoConsoleOutput.java
jdk/test/sun/security/krb5/ccache/EmptyCC.java
jdk/test/sun/security/krb5/tools/ktcheck.sh
jdk/test/sun/security/mscapi/PublicKeyInterop.sh
jdk/test/sun/security/mscapi/ShortRSAKey1024.sh
jdk/test/sun/security/provider/PolicyFile/Modules.java
jdk/test/sun/security/tools/jarsigner/AltProvider.java
jdk/test/sun/security/tools/jarsigner/ts.sh
jdk/test/sun/security/tools/keytool/autotest.sh
jdk/test/sun/security/tools/keytool/standard.sh
jdk/test/sun/security/validator/certreplace.sh
jdk/test/sun/security/validator/samedn.sh
jdk/test/sun/text/IntHashtable/Bug4170614Test.sh
jdk/test/sun/tools/java/CFCTest.java
jdk/test/sun/util/locale/provider/Bug8038436.java
jdk/test/tools/jar/modularJar/Basic.java
jdk/test/tools/jimage/VerifyJimage.java
jdk/test/tools/jlink/CustomPluginTest.java
jdk/test/tools/jlink/JLinkNegativeTest.java
jdk/test/tools/jlink/JLinkTest.java
jdk/test/tools/jlink/basic/BasicTest.java
jdk/test/tools/jlink/plugins/SystemModuleDescriptors/UserModuleTest.java
jdk/test/tools/jmod/JmodNegativeTest.java
jdk/test/tools/jmod/hashes/HashesTest.java
jdk/test/tools/launcher/MiscTests.java
jdk/test/tools/launcher/ToolsOpts.java
jdk/test/tools/launcher/modules/addexports/AddExportsTest.java
jdk/test/tools/launcher/modules/addmods/AddModsTest.java
jdk/test/tools/launcher/modules/addmods/src/logger/logger/Logger.java
jdk/test/tools/launcher/modules/addmods/src/test/test/Main.java
jdk/test/tools/launcher/modules/addreads/AddReadsTest.java
jdk/test/tools/launcher/modules/basic/BasicTest.java
jdk/test/tools/launcher/modules/dryrun/DryRunTest.java
jdk/test/tools/launcher/modules/limitmods/LimitModsTest.java
jdk/test/tools/launcher/modules/listmods/ListModsTest.java
jdk/test/tools/launcher/modules/patch/basic/PatchTest.java
jdk/test/tools/launcher/modules/patch/basic/src/test/jdk/test/Main.java
jdk/test/tools/launcher/modules/patch/systemmodules/PatchSystemModules.java
jdk/test/tools/launcher/modules/patch/systemmodules/src1/java.base/jdk/internal/modules/SystemModules.java
jdk/test/tools/launcher/modules/upgrademodulepath/UpgradeModulePathTest.java
jdk/test/tools/lib/tests/Helper.java
jdk/test/tools/lib/tests/JImageGenerator.java
jdk/test/tools/pack200/Utils.java
jdk/test/tools/pack200/pack200-verifier/make/build.xml
--- a/jdk/make/GenerateModuleSummary.gmk	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/make/GenerateModuleSummary.gmk	Wed Aug 10 15:51:25 2016 -0700
@@ -42,6 +42,6 @@
 
 $(GENGRAPHS_DIR)/module-summary.html: $(BUILD_JIGSAW_TOOLS) $(GENGRAPHS_DIR)/technology-summary.html
 	$(MKDIR) -p $(@D)
-	$(TOOL_MODULESUMMARY) -o $@ -mp $(IMAGES_OUTPUTDIR)/jmods
+	$(TOOL_MODULESUMMARY) -o $@ --module-path $(IMAGES_OUTPUTDIR)/jmods
 
 all: $(GENGRAPHS_DIR)/jdk.dot $(GENGRAPHS_DIR)/module-summary.html
--- a/jdk/make/ModuleTools.gmk	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/make/ModuleTools.gmk	Wed Aug 10 15:51:25 2016 -0700
@@ -36,12 +36,12 @@
     INCLUDES := build/tools/deps \
                 build/tools/jigsaw, \
     BIN := $(TOOLS_CLASSES_DIR), \
-    ADD_JAVAC_FLAGS := -XaddExports:jdk.jdeps/com.sun.tools.classfile=ALL-UNNAMED ))
+    ADD_JAVAC_FLAGS := --add-exports jdk.jdeps/com.sun.tools.classfile=ALL-UNNAMED ))
 
 
 TOOL_GENGRAPHS := $(BUILD_JAVA) -esa -ea -cp $(TOOLS_CLASSES_DIR) \
     build.tools.jigsaw.GenGraphs
 
 TOOL_MODULESUMMARY := $(BUILD_JAVA) -esa -ea -cp $(TOOLS_CLASSES_DIR) \
-    -XaddExports:jdk.jdeps/com.sun.tools.classfile=ALL-UNNAMED \
+    --add-exports jdk.jdeps/com.sun.tools.classfile=ALL-UNNAMED \
     build.tools.jigsaw.ModuleSummary
--- a/jdk/make/Tools.gmk	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/make/Tools.gmk	Wed Aug 10 15:51:25 2016 -0700
@@ -38,7 +38,7 @@
 ################################################################################
 
 ifeq ($(BOOT_JDK_MODULAR), true)
-  COMPILEFONTCONFIG_ADD_EXPORTS := -XaddExports:java.desktop/sun.awt=ALL-UNNAMED
+  COMPILEFONTCONFIG_ADD_EXPORTS := --add-exports java.desktop/sun.awt=ALL-UNNAMED
 endif
 
 TOOL_COMPILEFONTCONFIG = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
@@ -94,7 +94,7 @@
 # Nimbus is used somewhere in the swing build.
 
 ifeq ($(BOOT_JDK_MODULAR), true)
-  COMPILENIMBUS_ADD_MODS := -addmods java.xml.bind
+  COMPILENIMBUS_ADD_MODS := --add-modules java.xml.bind
 endif
 
 TOOL_GENERATENIMBUS = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
--- a/jdk/make/gendata/GendataBreakIterator.gmk	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/make/gendata/GendataBreakIterator.gmk	Wed Aug 10 15:51:25 2016 -0700
@@ -63,11 +63,11 @@
 
 ifeq ($(BOOT_JDK_MODULAR), true)
   BREAK_ITERATOR_BOOTCLASSPATH := \
-      -Xpatch:java.base=$(BREAK_ITERATOR_CLASSES)/java.base \
-      -Xpatch:jdk.localedata=$(BREAK_ITERATOR_CLASSES)/jdk.localedata \
-      -XaddExports:java.base/sun.text=ALL-UNNAMED \
-      -XaddExports:java.base/sun.text.resources=ALL-UNNAMED \
-      -XaddExports:jdk.localedata/sun.text.resources.ext=ALL-UNNAMED \
+      --patch-module java.base=$(BREAK_ITERATOR_CLASSES)/java.base \
+      --patch-module jdk.localedata=$(BREAK_ITERATOR_CLASSES)/jdk.localedata \
+      --add-exports java.base/sun.text=ALL-UNNAMED \
+      --add-exports java.base/sun.text.resources=ALL-UNNAMED \
+      --add-exports jdk.localedata/sun.text.resources.ext=ALL-UNNAMED \
       #
 else
   BREAK_ITERATOR_BOOTCLASSPATH := -Xbootclasspath/p:$(call PathList, \
--- a/jdk/make/launcher/Launcher-java.desktop.gmk	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/make/launcher/Launcher-java.desktop.gmk	Wed Aug 10 15:51:25 2016 -0700
@@ -31,7 +31,7 @@
 ifndef BUILD_HEADLESS_ONLY
   $(eval $(call SetupBuildLauncher, appletviewer, \
       MAIN_CLASS := sun.applet.Main, \
-      JAVA_ARGS := -addmods ALL-DEFAULT, \
+      JAVA_ARGS := --add-modules ALL-DEFAULT, \
       LIBS_unix := $(X_LIBS), \
   ))
 endif
--- a/jdk/make/launcher/Launcher-java.scripting.gmk	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/make/launcher/Launcher-java.scripting.gmk	Wed Aug 10 15:51:25 2016 -0700
@@ -27,5 +27,5 @@
 
 $(eval $(call SetupBuildLauncher, jrunscript, \
     MAIN_CLASS := com.sun.tools.script.shell.Main, \
-    JAVA_ARGS := -addmods ALL-DEFAULT, \
+    JAVA_ARGS := --add-modules ALL-DEFAULT, \
 ))
--- a/jdk/make/launcher/Launcher-jdk.compiler.gmk	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/make/launcher/Launcher-jdk.compiler.gmk	Wed Aug 10 15:51:25 2016 -0700
@@ -27,7 +27,7 @@
 
 $(eval $(call SetupBuildLauncher, javac, \
    MAIN_CLASS := com.sun.tools.javac.Main, \
-   JAVA_ARGS := -addmods ALL-DEFAULT, \
+   JAVA_ARGS := --add-modules ALL-DEFAULT, \
    CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS \
         -DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \
 ))
--- a/jdk/make/launcher/Launcher-jdk.javadoc.gmk	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/make/launcher/Launcher-jdk.javadoc.gmk	Wed Aug 10 15:51:25 2016 -0700
@@ -27,7 +27,7 @@
 
 $(eval $(call SetupBuildLauncher, javadoc, \
     MAIN_CLASS := jdk.javadoc.internal.tool.Main, \
-    JAVA_ARGS := -addmods ALL-DEFAULT, \
+    JAVA_ARGS := --add-modules ALL-DEFAULT, \
     CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS \
         -DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \
 ))
--- a/jdk/make/launcher/Launcher-jdk.jlink.gmk	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/make/launcher/Launcher-jdk.jlink.gmk	Wed Aug 10 15:51:25 2016 -0700
@@ -32,7 +32,7 @@
 
 $(eval $(call SetupBuildLauncher, jlink,\
     MAIN_CLASS := jdk.tools.jlink.internal.Main, \
-    JAVA_ARGS := -addmods ALL-DEFAULT, \
+    JAVA_ARGS :=  --add-modules ALL-DEFAULT, \
     CFLAGS := -DENABLE_ARG_FILES \
         -DEXPAND_CLASSPATH_WILDCARDS \
         -DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \
--- a/jdk/make/launcher/Launcher-jdk.scripting.nashorn.shell.gmk	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/make/launcher/Launcher-jdk.scripting.nashorn.shell.gmk	Wed Aug 10 15:51:25 2016 -0700
@@ -27,6 +27,6 @@
 
 $(eval $(call SetupBuildLauncher, jjs, \
     MAIN_CLASS := jdk.nashorn.tools.jjs.Main, \
-    JAVA_ARGS := -addmods ALL-DEFAULT, \
+    JAVA_ARGS := --add-modules ALL-DEFAULT, \
     CFLAGS := -DENABLE_ARG_FILES, \
 ))
--- a/jdk/make/src/classes/build/tools/jigsaw/ModuleSummary.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/make/src/classes/build/tools/jigsaw/ModuleSummary.java	Wed Aug 10 15:51:25 2016 -0700
@@ -51,7 +51,7 @@
 import static build.tools.jigsaw.ModuleSummary.HtmlDocument.Division.*;
 
 public class ModuleSummary {
-    private static final String USAGE = "Usage: ModuleSummary -mp <dir> -o <outfile> [-root mn]*";
+    private static final String USAGE = "Usage: ModuleSummary --module-path <dir> -o <outfile> [--root mn]*";
 
     public static void main(String[] args) throws Exception {
         int i=0;
@@ -61,13 +61,13 @@
         while (i < args.length && args[i].startsWith("-")) {
             String arg = args[i++];
             switch (arg) {
-                case "-mp":
+                case "--module-path":
                     modpath = Paths.get(args[i++]);
                     break;
                 case "-o":
                     outfile = Paths.get(args[i++]);
                     break;
-                case "-root":
+                case "--root":
                     roots.add(args[i++]);
                 default:
                     System.err.println(USAGE);
--- a/jdk/src/java.base/share/classes/java/lang/System.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/src/java.base/share/classes/java/lang/System.java	Wed Aug 10 15:51:25 2016 -0700
@@ -644,23 +644,20 @@
      * <code>getProperties</code> operation, it may choose to permit the
      * {@link #getProperty(String)} operation.
      *
-     * @implNote In addition to the standard system properties, the {@code
-     * java} launcher may create the Java Virtual Machine with system
-     * properties that have the following keys:
+     * @implNote In addition to the standard system properties, the system
+     * properties may include the following keys:
      * <table summary="Shows property keys and associated values">
      * <tr><th>Key</th>
      *     <th>Description of Associated Value</th></tr>
      * <tr><td>{@code jdk.module.path}</td>
-     *     <td>Application module path</td></tr>
-     * <tr><td>{@code jdk.upgrade.module.path}</td>
+     *     <td>The application module path</td></tr>
+     * <tr><td>{@code jdk.module.upgrade.path}</td>
      *     <td>The upgrade module path</td></tr>
      * <tr><td>{@code jdk.module.main}</td>
      *     <td>The module name of the initial/main module</td></tr>
      * <tr><td>{@code jdk.module.main.class}</td>
      *     <td>The main class name of the initial module</td></tr>
      * </table>
-     * These properties may also be set by custom launchers that use the JNI
-     * invocation API to create the Java Virtual Machine.
      *
      * @return     the system properties
      * @exception  SecurityException  if a security manager exists and its
--- a/jdk/src/java.base/share/classes/java/lang/module/ModuleReference.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/src/java.base/share/classes/java/lang/module/ModuleReference.java	Wed Aug 10 15:51:25 2016 -0700
@@ -169,7 +169,7 @@
 
 
     /**
-     * Returns {@code true} if this module has been patched via -Xpatch.
+     * Returns {@code true} if this module has been patched via --patch-module.
      */
     boolean isPatched() {
         return patched;
--- a/jdk/src/java.base/share/classes/java/lang/module/ModuleReferences.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/src/java.base/share/classes/java/lang/module/ModuleReferences.java	Wed Aug 10 15:51:25 2016 -0700
@@ -68,7 +68,7 @@
 
     /**
      * Creates a ModuleReference to a module or to patched module when
-     * creating modules for the boot Layer and -Xpatch is specified.
+     * creating modules for the boot Layer and --patch-module is specified.
      */
     private static ModuleReference newModule(ModuleDescriptor md,
                                              URI uri,
--- a/jdk/src/java.base/share/classes/java/lang/module/SystemModuleFinder.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/src/java.base/share/classes/java/lang/module/SystemModuleFinder.java	Wed Aug 10 15:51:25 2016 -0700
@@ -178,7 +178,7 @@
         ModuleReference mref =
             new ModuleReference(md, uri, readerSupplier, hash);
 
-        // may need a reference to a patched module if -Xpatch specified
+        // may need a reference to a patched module if --patch-module specified
         mref = ModulePatcher.interposeIfNeeded(mref);
 
         return mref;
--- a/jdk/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java	Wed Aug 10 15:51:25 2016 -0700
@@ -56,8 +56,8 @@
  * The {@link #boot() boot} method is called early in the startup to initialize
  * the module system. In summary, the boot method creates a Configuration by
  * resolving a set of module names specified via the launcher (or equivalent)
- * -m and -addmods options. The modules are located on a module path that is
- * constructed from the upgrade module path, system modules, and application
+ * -m and --add-modules options. The modules are located on a module path that
+ * is constructed from the upgrade module path, system modules, and application
  * module path. The Configuration is instantiated as the boot Layer with each
  * module in the the configuration defined to one of the built-in class loaders.
  */
@@ -127,16 +127,16 @@
 
         long t2 = System.nanoTime();
 
-        // -upgrademodulepath option specified to launcher
+        // --upgrade-module-path option specified to launcher
         ModuleFinder upgradeModulePath
-            = createModulePathFinder("jdk.upgrade.module.path");
+            = createModulePathFinder("jdk.module.upgrade.path");
         if (upgradeModulePath != null)
             systemModules = ModuleFinder.compose(upgradeModulePath, systemModules);
 
-        // -modulepath option specified to the launcher
+        // --module-path option specified to the launcher
         ModuleFinder appModulePath = createModulePathFinder("jdk.module.path");
 
-        // The module finder: [-upgrademodulepath] system [-modulepath]
+        // The module finder: [--upgrade-module-path] system [--module-path]
         ModuleFinder finder = systemModules;
         if (appModulePath != null)
             finder = ModuleFinder.compose(finder, appModulePath);
@@ -149,11 +149,11 @@
         if (mainModule != null)
             roots.add(mainModule);
 
-        // additional module(s) specified by -addmods
+        // additional module(s) specified by --add-modules
         boolean addAllDefaultModules = false;
         boolean addAllSystemModules = false;
         boolean addAllApplicationModules = false;
-        String propValue = System.getProperty("jdk.launcher.addmods");
+        String propValue = getAndRemoveProperty("jdk.module.addmods");
         if (propValue != null) {
             for (String mod: propValue.split(",")) {
                 switch (mod) {
@@ -172,8 +172,8 @@
             }
         }
 
-        // -limitmods
-        propValue = System.getProperty("jdk.launcher.limitmods");
+        // --limit-modules
+        propValue = getAndRemoveProperty("jdk.module.limitmods");
         if (propValue != null) {
             Set<String> mods = new HashSet<>();
             for (String mod: propValue.split(",")) {
@@ -216,7 +216,7 @@
             }
         }
 
-        // If `-addmods ALL-SYSTEM` is specified then all observable system
+        // If `--add-modules ALL-SYSTEM` is specified then all observable system
         // modules will be resolved.
         if (addAllSystemModules) {
             ModuleFinder f = finder;  // observable modules
@@ -228,9 +228,9 @@
                 .forEach(mn -> roots.add(mn));
         }
 
-        // If `-addmods ALL-MODULE-PATH` is specified then all observable
+        // If `--add-modules ALL-MODULE-PATH` is specified then all observable
         // modules on the application module path will be resolved.
-        if  (appModulePath != null && addAllApplicationModules) {
+        if (appModulePath != null && addAllApplicationModules) {
             ModuleFinder f = finder;  // observable modules
             appModulePath.findAll()
                 .stream()
@@ -250,7 +250,7 @@
         if (baseUri.getScheme().equals("jrt")   // toLowerCase not needed here
                 && (upgradeModulePath == null)
                 && (appModulePath == null)
-                && (System.getProperty("jdk.launcher.patch.0") == null)) {
+                && (!ModulePatcher.isBootLayerPatched())) {
             needPostResolutionChecks = false;
         }
 
@@ -317,7 +317,7 @@
         PerfCounters.loadModulesTime.addElapsedTimeFrom(t5);
 
 
-        // -XaddReads and -XaddExports
+        // --add-reads and --add-exports
         addExtraReads(bootLayer);
         addExtraExports(bootLayer);
 
@@ -394,13 +394,13 @@
 
 
     /**
-     * Process the -XaddReads options to add any additional read edges that
+     * Process the --add-reads options to add any additional read edges that
      * are specified on the command-line.
      */
     private static void addExtraReads(Layer bootLayer) {
 
         // decode the command line options
-        Map<String, Set<String>> map = decode("jdk.launcher.addreads.");
+        Map<String, Set<String>> map = decode("jdk.module.addreads.");
 
         for (Map.Entry<String, Set<String>> e : map.entrySet()) {
 
@@ -431,13 +431,13 @@
 
 
     /**
-     * Process the -XaddExports options to add any additional read edges that
+     * Process the --add-exports options to add any additional read edges that
      * are specified on the command-line.
      */
     private static void addExtraExports(Layer bootLayer) {
 
         // decode the command line options
-        Map<String, Set<String>> map = decode("jdk.launcher.addexports.");
+        Map<String, Set<String>> map = decode("jdk.module.addexports.");
 
         for (Map.Entry<String, Set<String>> e : map.entrySet()) {
 
@@ -483,13 +483,14 @@
 
 
     /**
-     * Decodes the values of -XaddReads or -XaddExports options
+     * Decodes the values of --add-reads or --add-exports options
      *
      * The format of the options is: $KEY=$MODULE(,$MODULE)*
      */
     private static Map<String, Set<String>> decode(String prefix) {
         int index = 0;
-        String value = System.getProperty(prefix + index);
+        // the system property is removed after decoding
+        String value = getAndRemoveProperty(prefix + index);
         if (value == null)
             return Collections.emptyMap();
 
@@ -522,12 +523,18 @@
             }
 
             index++;
-            value = System.getProperty(prefix + index);
+            value = getAndRemoveProperty(prefix + index);
         }
 
         return map;
     }
 
+    /**
+     * Gets and remove the named system property
+     */
+    private static String getAndRemoveProperty(String key) {
+        return (String)System.getProperties().remove(key);
+    }
 
     /**
      * Throws a RuntimeException with the given message
--- a/jdk/src/java.base/share/classes/jdk/internal/module/ModulePatcher.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/src/java.base/share/classes/jdk/internal/module/ModulePatcher.java	Wed Aug 10 15:51:25 2016 -0700
@@ -58,7 +58,7 @@
 
 
 /**
- * Provides support for patching modules in the boot layer with -Xpatch.
+ * Provides support for patching modules in the boot layer with --patch-module.
  */
 
 public final class ModulePatcher {
@@ -66,28 +66,27 @@
     private static final JavaLangModuleAccess JLMA
         = SharedSecrets.getJavaLangModuleAccess();
 
-    // the prefix of the system properties that encode the value of -Xpatch
-    private static final String PATCH_PROPERTY_PREFIX = "jdk.launcher.patch.";
+    // the prefix of the system properties that encode the value of --patch-module
+    private static final String PATCH_PROPERTY_PREFIX = "jdk.module.patch.";
 
     // module name -> sequence of patches (directories or JAR files)
     private static final Map<String, List<Path>> PATCH_MAP = decodeProperties();
 
     private ModulePatcher() { }
 
-
     /**
-     * Decodes the values of -Xpatch options, returning a Map of module name to
-     * list of file paths.
+     * Decodes the values of --patch-module options, returning a Map of module
+     * name to list of file paths.
      *
      * @throws IllegalArgumentException if the the module name is missing or
-     *         -Xpatch is used more than once to patch the same module
+     *         --patch-module is used more than once to patch the same module
      */
     private static Map<String, List<Path>> decodeProperties() {
 
         int index = 0;
-        String value = System.getProperty(PATCH_PROPERTY_PREFIX + index);
+        String value = getAndRemoveProperty(PATCH_PROPERTY_PREFIX + index);
         if (value == null)
-            return Collections.emptyMap();  // -Xpatch not specified
+            return Collections.emptyMap();  // --patch-module not specified
 
         Map<String, List<Path>> map = new HashMap<>();
         while (value != null) {
@@ -115,7 +114,7 @@
             }
 
             index++;
-            value = System.getProperty(PATCH_PROPERTY_PREFIX + index);
+            value = getAndRemoveProperty(PATCH_PROPERTY_PREFIX + index);
         }
 
         return map;
@@ -123,6 +122,14 @@
 
 
     /**
+     * Returns {@code true} is --patch-module is specified to patch modules
+     * in the boot layer.
+     */
+    static boolean isBootLayerPatched() {
+        return !PATCH_MAP.isEmpty();
+    }
+
+    /**
      * Returns a module reference that interposes on the given module if
      * needed. If there are no patches for the given module then the module
      * reference is simply returned. Otherwise the patches for the module
@@ -537,6 +544,13 @@
     }
 
     /**
+     * Gets and remove the named system property
+     */
+    private static String getAndRemoveProperty(String key) {
+        return (String)System.getProperties().remove(key);
+    }
+
+    /**
      * Derives a package name from the name of an entry in a JAR file.
      */
     private static String toPackageName(Path file, JarEntry entry) {
--- a/jdk/src/java.base/share/classes/sun/launcher/LauncherHelper.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/src/java.base/share/classes/sun/launcher/LauncherHelper.java	Wed Aug 10 15:51:25 2016 -0700
@@ -60,8 +60,6 @@
 import java.nio.file.DirectoryStream;
 import java.nio.file.Files;
 import java.nio.file.Path;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
 import java.text.Normalizer;
 import java.text.MessageFormat;
 import java.util.ResourceBundle;
@@ -905,7 +903,7 @@
 
         ModuleFinder finder = jdk.internal.module.ModuleBootstrap.finder();
 
-        int colon = optionFlag.indexOf(':');
+        int colon = optionFlag.indexOf('=');
         if (colon == -1) {
             finder.findAll().stream()
                 .sorted(Comparator.comparing(ModuleReference::descriptor))
--- a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher.properties	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher.properties	Wed Aug 10 15:51:25 2016 -0700
@@ -27,7 +27,7 @@
 java.launcher.opt.header  =   Usage: {0} [options] class [args...]\n\
 \           (to execute a class)\n   or  {0} [options] -jar jarfile [args...]\n\
 \           (to execute a jar file)\n\
-\   or  {0} [options] -mp <modulepath> -m <modulename>[/<mainclass>] [args...]\n\
+\   or  {0} [options] -p <modulepath> -m <modulename>[/<mainclass>] [args...]\n\
 \           (to execute the main class in a module)\n\
 where options include:\n
 
@@ -41,24 +41,28 @@
 # Translators please note do not translate the options themselves
 java.launcher.opt.footer     =\    -cp <class search path of directories and zip/jar files>\n\
 \    -classpath <class search path of directories and zip/jar files>\n\
+\    --class-path <class search path of directories and zip/jar files>\n\
 \                  A {0} separated list of directories, JAR archives,\n\
 \                  and ZIP archives to search for class files.\n\
-\    -mp <module path>\n\
-\    -modulepath <module path>...\n\
+\    -p <module path>\n\
+\    --module-path <module path>...\n\
 \                  A {0} separated list of directories, each directory\n\
 \                  is a directory of modules.\n\
-\    -upgrademodulepath <module path>...\n\
+\    --upgrade-module-path <module path>...\n\
 \                  A {0} separated list of directories, each directory\n\
 \                  is a directory of modules that replace upgradeable\n\
 \                  modules in the runtime image\n\
-\    -m <modulename>[/<mainclass>]\n\
+\    -m <module>[/<mainclass>]\n\
+\    --module <modulename>[/<mainclass>]\n\
 \                  the initial module to resolve, and the name of the main class\n\
 \                  to execute if not specified by the module\n\
-\    -addmods <modulename>[,<modulename>...]\n\
-\                  root modules to resolve in addition to the initial module\n\
-\    -limitmods <modulename>[,<modulename>...]\n\
+\    --add-modules <modulename>[,<modulename>...]\n\
+\                  root modules to resolve in addition to the initial module.\n\
+\                  <modulename> can also be ALL-DEFAULT, ALL-SYSTEM,\n\
+\                  ALL-MODULE-PATH.\n\
+\    --limit-modules <modulename>[,<modulename>...]\n\
 \                  limit the universe of observable modules\n\
-\    -listmods[:<modulename>[,<modulename>...]]\n\
+\    --list-modules [<modulename>[,<modulename>...]]\n\
 \                  list the observable modules and exit\n\
 \    --dry-run     create VM but do not execute main method.\n\
 \                  This --dry-run option may be useful for validating the\n\
@@ -69,7 +73,8 @@
 \                  enable verbose output\n\
 \    -version      print product version and exit\n\
 \    -showversion  print product version and continue\n\
-\    -? -help      print this help message\n\
+\    -? -help --help\n\
+\                  print this help message\n\
 \    -X            print help on non-standard options\n\
 \    -ea[:<packagename>...|:<classname>]\n\
 \    -enableassertions[:<packagename>...|:<classname>]\n\
@@ -91,6 +96,8 @@
 \    -splash:<imagepath>\n\
 \                  show splash screen with specified image\n\
 \    @<filepath>   read options from the specified file\n\
+\To specify an argument for a long option, you can use --<name>=<value> or\n\
+\--<name> <value>.\n\
 
 See http://www.oracle.com/technetwork/java/javase/documentation/index.html for more details.
 
@@ -123,17 +130,21 @@
 \                      show all property settings and continue\n\
 \    -XshowSettings:locale\n\
 \                      show all locale related settings and continue\n\
-\    -XaddReads:<module>=<other-module>(,<other-module>)*\n\
-\                      <module> reads other modules,\n\
-\                      regardless of module declaration\n\
-\    -XaddExports:<module>/<package>=<other-module>(,<other-module>)*\n\
-\                      <module> exports <package> to other modules,\n\
-\                      regardless of module declaration\n\
-\    -Xpatch:<module>=<file>({0}<file>)*\n\
+\    -Xdisable-@files  disable further argument file expansion\n\
+\    --add-reads <module>=<target-module>(,<target-module>)*\n\
+\                      updates <module> to read <target-module>, regardless\n\
+\                      of module declaration. \n\
+\                      <target-module> can be ALL-UNNAMED to read all unnamed\n\
+\                      modules.\n\
+\    --add-exports <module>/<package>=<target-module>(,<target-module>)*\n\
+\                      updates <module> to export <package> to <target-module>,\n\
+\                      regardless of module declaration.\n\
+\                      <target-module> can be ALL-UNNAMED to export to all\n\
+\                      unnamed modules.\n\
+\    --patch-module <module>=<file>({0}<file>)*\n\
 \                      Override or augment a module with classes and resources\n\
-\                      in JAR files or directories\n\
-\    -Xdisable-@files  disable further argument file expansion\n\n\
-The -X options are non-standard and subject to change without notice.\n
+\                      in JAR files or directories.\n\n\
+These options are non-standard and subject to change without notice.\n
 
 # Translators please note do not translate the options themselves
 java.launcher.X.macosx.usage=\
--- a/jdk/src/java.base/share/native/libjli/args.c	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/src/java.base/share/native/libjli/args.c	Wed Aug 10 15:51:25 2016 -0700
@@ -102,24 +102,21 @@
 
     // All arguments arrive here must be a launcher argument,
     // ie. by now, all argfile expansions must have been performed.
-    if (*arg++ == '-') {
+    if (*arg == '-') {
         expectingNoDashArg = JNI_FALSE;
-        if (JLI_StrCmp(arg, "cp") == 0 ||
-            JLI_StrCmp(arg, "classpath") == 0 ||
-            JLI_StrCmp(arg, "addmods") == 0 ||
-            JLI_StrCmp(arg, "limitmods") == 0 ||
-            JLI_StrCmp(arg, "mp") == 0 ||
-            JLI_StrCmp(arg, "modulepath") == 0 ||
-            JLI_StrCmp(arg, "upgrademodulepath") == 0) {
+        if (IsWhiteSpaceOption(arg)) {
+            // expect an argument
             expectingNoDashArg = JNI_TRUE;
-        } else if (JLI_StrCmp(arg, "jar") == 0 ||
-                   JLI_StrCmp(arg, "m") == 0) {
-            // This is tricky, we do expect NoDashArg
-            // But that is considered main class to stop expansion
-            expectingNoDashArg = JNI_FALSE;
-            // We can not just update the idx here because if -jar @file
-            // still need expansion of @file to get the argument for -jar
-        } else if (JLI_StrCmp(arg, "Xdisable-@files") == 0) {
+
+            if (JLI_StrCmp(arg, "-jar") == 0 ||
+                JLI_StrCmp(arg, "-m") == 0) {
+                // This is tricky, we do expect NoDashArg
+                // But that is considered main class to stop expansion
+                expectingNoDashArg = JNI_FALSE;
+                // We can not just update the idx here because if -jar @file
+                // still need expansion of @file to get the argument for -jar
+            }
+        } else if (JLI_StrCmp(arg, "-Xdisable-@files") == 0) {
             stopExpansion = JNI_TRUE;
         }
     } else {
--- a/jdk/src/java.base/share/native/libjli/java.c	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/src/java.base/share/native/libjli/java.c	Wed Aug 10 15:51:25 2016 -0700
@@ -69,7 +69,7 @@
 static jboolean printUsage = JNI_FALSE;   /* print and exit*/
 static jboolean printXUsage = JNI_FALSE;  /* print and exit*/
 static jboolean dryRun = JNI_FALSE;       /* initialize VM and exit */
-static char     *showSettings = NULL;      /* print but continue */
+static char     *showSettings = NULL;     /* print but continue */
 static char     *listModules = NULL;
 
 static const char *_program_name;
@@ -99,17 +99,9 @@
  * Prototypes for functions internal to launcher.
  */
 static void SetClassPath(const char *s);
-static void SetModulePath(const char *s);
-static void SetUpgradeModulePath(const char *s);
 static void SetMainModule(const char *s);
-static void SetAddModulesProp(const char *mods);
-static void SetLimitModulesProp(const char *mods);
-static void SetAddReadsProp(const jint n, const char *s);
-static void SetAddExportsProp(const jint n, const char *s);
-static void SetPatchProp(const jint n, const char *s);
 static void SelectVersion(int argc, char **argv, char **main_class);
 static void SetJvmEnvironment(int argc, char **argv);
-static jboolean IsWhiteSpaceOptionArgument(const char* name);
 static jboolean ParseArguments(int *pargc, char ***pargv,
                                int *pmode, char **pwhat,
                                int *pret, const char *jrepath);
@@ -133,6 +125,18 @@
 static void DumpState();
 static jboolean RemovableOption(char *option);
 
+enum OptionKind {
+    LAUNCHER_OPTION = 0,
+    LAUNCHER_OPTION_WITH_ARGUMENT,
+    LAUNCHER_MAIN_OPTION,
+    VM_LONG_OPTION,
+    VM_LONG_OPTION_WITH_ARGUMENT,
+    VM_OPTION
+};
+
+static int GetOpt(int *pargc, char ***pargv, char **poption, char **pvalue);
+static jboolean IsOptionWithArgument(int argc, char **argv);
+
 /* Maximum supported entries from jvm.cfg. */
 #define INIT_MAX_KNOWN_VMS      10
 
@@ -162,6 +166,19 @@
 static void FreeKnownVMs();
 static jboolean IsWildCardEnabled();
 
+/*
+ * This reports error.  VM will not be created and no usage is printed.
+ */
+#define REPORT_ERROR(AC_ok, AC_failure_message, AC_questionable_arg) \
+    do { \
+        if (!AC_ok) { \
+            JLI_ReportErrorMessage(AC_failure_message, AC_questionable_arg); \
+            printUsage = JNI_FALSE; \
+            *pret = 1; \
+            return JNI_FALSE; \
+        } \
+    } while (JNI_FALSE)
+
 #define ARG_CHECK(AC_arg_count, AC_failure_message, AC_questionable_arg) \
     do { \
         if (AC_arg_count < 1) { \
@@ -511,17 +528,73 @@
 }
 
 /*
- * Test if the given option name has a whitespace separated argument.
+ * Test if the given name is one of the class path options.
  */
-jboolean
-IsWhiteSpaceOptionArgument(const char* name) {
+static jboolean
+IsClassPathOption(const char* name) {
     return JLI_StrCmp(name, "-classpath") == 0 ||
            JLI_StrCmp(name, "-cp") == 0 ||
-           JLI_StrCmp(name, "-modulepath") == 0 ||
-           JLI_StrCmp(name, "-mp") == 0 ||
-           JLI_StrCmp(name, "-upgrademodulepath") == 0 ||
-           JLI_StrCmp(name, "-addmods") == 0 ||
-           JLI_StrCmp(name, "-limitmods") == 0;
+           JLI_StrCmp(name, "--class-path") == 0;
+}
+
+/*
+ * Test if the given name is a launcher option taking the main entry point.
+ */
+static jboolean
+IsLauncherMainOption(const char* name) {
+    return JLI_StrCmp(name, "--module") == 0 ||
+           JLI_StrCmp(name, "-m") == 0;
+}
+
+/*
+ * Test if the given name is a white-space launcher option.
+ */
+static jboolean
+IsLauncherOption(const char* name) {
+    return IsClassPathOption(name) ||
+           IsLauncherMainOption(name) ||
+           JLI_StrCmp(name, "--list-modules") == 0;
+}
+
+#ifndef OLD_MODULE_OPTIONS
+/*
+ * Old module options for transition
+ */
+static jboolean
+IsOldModuleOption(const char* name) {
+    return JLI_StrCmp(name, "-modulepath") == 0 ||
+    JLI_StrCmp(name, "-mp") == 0 ||
+    JLI_StrCmp(name, "-upgrademodulepath") == 0 ||
+    JLI_StrCmp(name, "-addmods") == 0 ||
+    JLI_StrCmp(name, "-limitmods") == 0;
+}
+#endif
+
+/*
+ * Test if the given name is a module-system white-space option that
+ * will be passed to the VM with its corresponding long-form option
+ * name and "=" delimiter.
+ */
+static jboolean
+IsModuleOption(const char* name) {
+    return JLI_StrCmp(name, "--module-path") == 0 ||
+           JLI_StrCmp(name, "-p") == 0 ||
+           JLI_StrCmp(name, "--upgrade-module-path") == 0 ||
+           JLI_StrCmp(name, "--add-modules") == 0 ||
+           JLI_StrCmp(name, "--limit-modules") == 0 ||
+           JLI_StrCmp(name, "--add-exports") == 0 ||
+           JLI_StrCmp(name, "--add-reads") == 0 ||
+           JLI_StrCmp(name, "--patch-module") == 0 ||
+           IsOldModuleOption(name);
+}
+
+/*
+ * Test if the given name has a white space option.
+ */
+jboolean
+IsWhiteSpaceOption(const char* name) {
+    return IsModuleOption(name) ||
+           IsLauncherOption(name);
 }
 
 /*
@@ -559,7 +632,7 @@
                 continue;
             }
         } else {
-            if (IsWhiteSpaceOptionArgument(arg)) {
+            if (IsWhiteSpaceOption(arg)) {
                 newArgv[newArgvIdx++] = arg;
                 argi++;
                 if (argi < argc) {
@@ -701,7 +774,7 @@
         if (i > 0) {
             char *prev = argv[i - 1];
             // skip non-dash arg preceded by class path specifiers
-            if (*arg != '-' && IsWhiteSpaceOptionArgument(prev)) {
+            if (*arg != '-' && IsWhiteSpaceOption(prev)) {
                 continue;
             }
 
@@ -709,6 +782,7 @@
                     || JLI_StrCmp(arg, "-version") == 0
                     || JLI_StrCmp(arg, "-fullversion") == 0
                     || JLI_StrCmp(arg, "-help") == 0
+                    || JLI_StrCmp(arg, "--help") == 0
                     || JLI_StrCmp(arg, "-?") == 0
                     || JLI_StrCmp(arg, "-jar") == 0
                     || JLI_StrCmp(arg, "-X") == 0) {
@@ -882,39 +956,16 @@
 }
 
 static void
-SetModulePath(const char *s)
+AddLongFormOption(const char *option, const char *arg)
 {
+    static const char format[] = "%s=%s";
     char *def;
-    const char *orig = s;
-    static const char format[] = "-Djdk.module.path=%s";
-    if (s == NULL)
-        return;
-    s = JLI_WildcardExpandClasspath(s);
-    def = JLI_MemAlloc(sizeof(format)
-                       - 2 /* strlen("%s") */
-                       + JLI_StrLen(s));
-    sprintf(def, format, s);
-    AddOption(def, NULL);
-    if (s != orig)
-        JLI_MemFree((char *) s);
-}
+    size_t def_len;
 
-static void
-SetUpgradeModulePath(const char *s)
-{
-    char *def;
-    const char *orig = s;
-    static const char format[] = "-Djdk.upgrade.module.path=%s";
-    if (s == NULL)
-        return;
-    s = JLI_WildcardExpandClasspath(s);
-    def = JLI_MemAlloc(sizeof(format)
-                       - 2 /* strlen("%s") */
-                       + JLI_StrLen(s));
-    sprintf(def, format, s);
+    def_len = JLI_StrLen(option) + 1 + JLI_StrLen(arg) + 1;
+    def = JLI_MemAlloc(def_len);
+    JLI_Snprintf(def, def_len, format, option, arg);
     AddOption(def, NULL);
-    if (s != orig)
-        JLI_MemFree((char *) s);
 }
 
 static void
@@ -939,46 +990,6 @@
     AddOption(def, NULL);
 }
 
-static void
-SetAddModulesProp(const char *mods) {
-    size_t buflen = JLI_StrLen(mods) + 40;
-    char *prop = (char *)JLI_MemAlloc(buflen);
-    JLI_Snprintf(prop, buflen, "-Djdk.launcher.addmods=%s", mods);
-    AddOption(prop, NULL);
-}
-
-static void
-SetLimitModulesProp(const char *mods) {
-    size_t buflen = JLI_StrLen(mods) + 40;
-    char *prop = (char *)JLI_MemAlloc(buflen);
-    JLI_Snprintf(prop, buflen, "-Djdk.launcher.limitmods=%s", mods);
-    AddOption(prop, NULL);
-}
-
-static void
-SetAddReadsProp(const jint n, const char *s) {
-    size_t buflen = JLI_StrLen(s) + 40;
-    char *prop = (char *)JLI_MemAlloc(buflen);
-    JLI_Snprintf(prop, buflen, "-Djdk.launcher.addreads.%d=%s", n, s);
-    AddOption(prop, NULL);
-}
-
-static void
-SetAddExportsProp(const jint n, const char *s) {
-    size_t buflen = JLI_StrLen(s) + 40;
-    char *prop = (char *)JLI_MemAlloc(buflen);
-    JLI_Snprintf(prop, buflen, "-Djdk.launcher.addexports.%d=%s", n, s);
-    AddOption(prop, NULL);
-}
-
-static void
-SetPatchProp(const jint n, const char *s) {
-    size_t buflen = JLI_StrLen(s) + 40;
-    char *prop = (char *)JLI_MemAlloc(buflen);
-    JLI_Snprintf(prop, buflen, "-Djdk.launcher.patch.%d=%s", n, s);
-    AddOption(prop, NULL);
-}
-
 /*
  * The SelectVersion() routine ensures that an appropriate version of
  * the JRE is running.  The specification for the appropriate version
@@ -1003,6 +1014,7 @@
     char    *splash_jar_name = NULL;
     char    *env_in;
     int     res;
+    jboolean has_arg;
 
     /*
      * If the version has already been selected, set *main_class
@@ -1033,9 +1045,11 @@
      * This capability is no longer available with JRE versions 1.9 and later.
      * These command line options are reported as errors.
      */
+
     argc--;
     argv++;
     while ((arg = *argv) != 0 && *arg == '-') {
+        has_arg = IsOptionWithArgument(argc, argv);
         if (JLI_StrCCmp(arg, "-version:") == 0) {
             JLI_ReportErrorMessage(SPC_ERROR1);
         } else if (JLI_StrCmp(arg, "-jre-restrict-search") == 0) {
@@ -1045,10 +1059,12 @@
         } else {
             if (JLI_StrCmp(arg, "-jar") == 0)
                 jarflag = 1;
-            if (IsWhiteSpaceOptionArgument(arg) && (argc >= 2)) {
-                argc--;
-                argv++;
-                arg = *argv;
+            if (IsWhiteSpaceOption(arg)) {
+                if (has_arg) {
+                    argc--;
+                    argv++;
+                    arg = *argv;
+                }
             }
 
             /*
@@ -1140,6 +1156,108 @@
 }
 
 /*
+ * Test if the current argv is an option, i.e. with a leading `-`
+ * and followed with an argument without a leading `-`.
+ */
+static jboolean
+IsOptionWithArgument(int argc, char** argv) {
+    char* option;
+    char* arg;
+
+    if (argc <= 1)
+        return JNI_FALSE;
+
+    option = *argv;
+    arg = *(argv+1);
+    return *option == '-' && *arg != '-';
+}
+
+/*
+ * Gets the option, and its argument if the option has an argument.
+ * It will update *pargc, **pargv to the next option.
+ */
+static int
+GetOpt(int *pargc, char ***pargv, char **poption, char **pvalue) {
+    int argc = *pargc;
+    char** argv = *pargv;
+    char* arg = *argv;
+
+    char* option = arg;
+    char* value = NULL;
+    char* equals = NULL;
+    int kind = LAUNCHER_OPTION;
+    jboolean has_arg = JNI_FALSE;
+
+    // check if this option may be a white-space option with an argument
+    has_arg = IsOptionWithArgument(argc, argv);
+
+    argv++; --argc;
+    if (IsLauncherOption(arg)) {
+        if (has_arg) {
+            value = *argv;
+            argv++; --argc;
+        }
+        kind = IsLauncherMainOption(arg) ? LAUNCHER_MAIN_OPTION
+                                         : LAUNCHER_OPTION_WITH_ARGUMENT;
+    } else if (IsModuleOption(arg)) {
+        kind = VM_LONG_OPTION_WITH_ARGUMENT;
+        if (has_arg) {
+            value = *argv;
+            argv++; --argc;
+        }
+
+        /*
+         * Support short form alias
+         */
+        if (JLI_StrCmp(arg, "-p") == 0) {
+            option = "--module-path";
+        }
+
+    } else if (JLI_StrCCmp(arg, "--") == 0 && (equals = JLI_StrChr(arg, '=')) != NULL) {
+        value = equals+1;
+        if (JLI_StrCCmp(arg, "--list-modules=") == 0 ||
+            JLI_StrCCmp(arg, "--module=") == 0 ||
+            JLI_StrCCmp(arg, "--class-path=") == 0) {
+            kind = LAUNCHER_OPTION_WITH_ARGUMENT;
+        } else {
+            kind = VM_LONG_OPTION;
+        }
+    }
+
+#ifndef OLD_MODULE_OPTIONS
+    // for transition to support both old and new syntax
+    if (JLI_StrCmp(arg, "-modulepath") == 0 ||
+        JLI_StrCmp(arg, "-mp") == 0) {
+        option = "--module-path";
+    } else if (JLI_StrCmp(arg, "-upgrademodulepath") == 0) {
+        option = "--upgrade-module-path";
+    } else if (JLI_StrCmp(arg, "-addmods") == 0) {
+        option = "--add-modules";
+    } else if (JLI_StrCmp(arg, "-limitmods") == 0) {
+        option = "--limit-modules";
+    } else if (JLI_StrCCmp(arg, "-XaddExports:") == 0) {
+        option = "--add-exports";
+        value = arg + 13;
+        kind = VM_LONG_OPTION_WITH_ARGUMENT;
+    } else if (JLI_StrCCmp(arg, "-XaddReads:") == 0) {
+        option = "--add-reads";
+        value = arg + 11;
+        kind = VM_LONG_OPTION_WITH_ARGUMENT;
+    } else if (JLI_StrCCmp(arg, "-Xpatch:") == 0) {
+        option = "--patch-module";
+        value = arg + 8;
+        kind = VM_LONG_OPTION_WITH_ARGUMENT;
+    }
+#endif
+
+    *pargc = argc;
+    *pargv = argv;
+    *poption = option;
+    *pvalue = value;
+    return kind;
+}
+
+/*
  * Parses command line arguments.  Returns JNI_FALSE if launcher
  * should exit without starting vm, returns JNI_TRUE if vm needs
  * to be started to process given options.  *pret (the launcher
@@ -1158,52 +1276,85 @@
     *pret = 0;
 
     while ((arg = *argv) != 0 && *arg == '-') {
-        argv++; --argc;
-        if (JLI_StrCmp(arg, "-classpath") == 0 || JLI_StrCmp(arg, "-cp") == 0) {
-            ARG_CHECK (argc, ARG_ERROR1, arg);
-            SetClassPath(*argv);
-            mode = LM_CLASS;
-            argv++; --argc;
-        } else if (JLI_StrCmp(arg, "-modulepath") == 0 || JLI_StrCmp(arg, "-mp") == 0) {
-            ARG_CHECK (argc, ARG_ERROR4, arg);
-            SetModulePath(*argv);
-            argv++; --argc;
-        } else if (JLI_StrCmp(arg, "-upgrademodulepath") == 0) {
-            ARG_CHECK (argc, ARG_ERROR4, arg);
-            SetUpgradeModulePath(*argv);
-            argv++; --argc;
-        } else if (JLI_StrCmp(arg, "-jar") == 0) {
-            ARG_CHECK (argc, ARG_ERROR2, arg);
+        char *option = NULL;
+        char *value = NULL;
+        int kind = GetOpt(&argc, &argv, &option, &value);
+        jboolean has_arg = value != NULL;
+
+/*
+ * Option to set main entry point
+ */
+        if (JLI_StrCmp(arg, "-jar") == 0) {
+            ARG_CHECK(argc, ARG_ERROR2, arg);
             mode = LM_JAR;
-        } else if (JLI_StrCmp(arg, "-m") == 0) {
-            ARG_CHECK (argc, ARG_ERROR5, arg);
-            SetMainModule(*argv);
+        } else if (JLI_StrCmp(arg, "--module") == 0 ||
+                   JLI_StrCCmp(arg, "--module=") == 0 ||
+                   JLI_StrCmp(arg, "-m") == 0) {
+            REPORT_ERROR (has_arg, ARG_ERROR5, arg);
+            SetMainModule(value);
             mode = LM_MODULE;
-        } else if (JLI_StrCmp(arg, "-addmods") == 0) {
-            ARG_CHECK (argc, ARG_ERROR6, arg);
-            SetAddModulesProp(*argv);
-            argv++; --argc;
-        } else if (JLI_StrCmp(arg, "-limitmods") == 0) {
-            ARG_CHECK (argc, ARG_ERROR6, arg);
-            SetLimitModulesProp(*argv);
-            argv++; --argc;
-        } else if (JLI_StrCmp(arg, "-listmods") == 0 ||
-                   JLI_StrCCmp(arg, "-listmods:") == 0) {
+            if (has_arg) {
+               *pwhat = value;
+                break;
+            }
+        } else if (JLI_StrCmp(arg, "--class-path") == 0 ||
+                   JLI_StrCCmp(arg, "--class-path=") == 0 ||
+                   JLI_StrCmp(arg, "-classpath") == 0 ||
+                   JLI_StrCmp(arg, "-cp") == 0) {
+            REPORT_ERROR (has_arg, ARG_ERROR1, arg);
+            SetClassPath(value);
+            mode = LM_CLASS;
+        } else if (JLI_StrCmp(arg, "--list-modules") == 0 ||
+                   JLI_StrCCmp(arg, "--list-modules=") == 0) {
             listModules = arg;
+
+            // set listModules to --list-modules=<module-names> if argument is specified
+            if (JLI_StrCmp(arg, "--list-modules") == 0 && has_arg) {
+                static const char format[] = "%s=%s";
+                size_t buflen = JLI_StrLen(option) + 2 + JLI_StrLen(value);
+                listModules = JLI_MemAlloc(buflen);
+                JLI_Snprintf(listModules, buflen, format, option, value);
+            }
             return JNI_TRUE;
-        } else if (JLI_StrCCmp(arg, "-XaddReads:") == 0) {
-            static jint n;
-            char *value = arg + 11;
-            SetAddReadsProp(n++, value);
-        } else if (JLI_StrCCmp(arg, "-XaddExports:") == 0) {
-            static jint n;
-            char *value = arg + 13;
-            SetAddExportsProp(n++, value);
-        } else if (JLI_StrCCmp(arg, "-Xpatch:") == 0) {
-            static jint n;
-            char *value = arg + 8;
-            SetPatchProp(n++, value);
-        } else if (JLI_StrCmp(arg, "-help") == 0 ||
+/*
+ * Parse white-space options
+ */
+        } else if (has_arg) {
+            if (kind == VM_LONG_OPTION) {
+                AddOption(option, NULL);
+            } else if (kind == VM_LONG_OPTION_WITH_ARGUMENT) {
+                AddLongFormOption(option, value);
+            }
+/*
+ * Error missing argument
+ */
+        } else if (!has_arg && IsWhiteSpaceOption(arg)) {
+            if (JLI_StrCmp(arg, "--module-path") == 0 ||
+                JLI_StrCmp(arg, "-p") == 0 ||
+                JLI_StrCmp(arg, "--upgrade-module-path") == 0) {
+                REPORT_ERROR (has_arg, ARG_ERROR4, arg);
+            } else if (JLI_StrCmp(arg, "--add-modules") == 0 ||
+                       JLI_StrCmp(arg, "--limit-modules") == 0 ||
+                       JLI_StrCmp(arg, "--add-exports") == 0 ||
+                       JLI_StrCmp(arg, "--add-reads") == 0 ||
+                       JLI_StrCmp(arg, "--patch-module") == 0) {
+                REPORT_ERROR (has_arg, ARG_ERROR6, arg);
+            }
+#ifndef OLD_MODULE_OPTIONS
+            else if (JLI_StrCmp(arg, "-modulepath") == 0 ||
+                     JLI_StrCmp(arg, "-mp") == 0 ||
+                     JLI_StrCmp(arg, "-upgrademodulepath") == 0) {
+                REPORT_ERROR (has_arg, ARG_ERROR4, arg);
+            } else if (JLI_StrCmp(arg, "-addmods") == 0 ||
+                       JLI_StrCmp(arg, "-limitmods") == 0) {
+                REPORT_ERROR (has_arg, ARG_ERROR6, arg);
+            }
+#endif
+/*
+ * The following cases will cause the argument parsing to stop
+ */
+        } else if (JLI_StrCmp(arg, "--help") == 0 ||
+                   JLI_StrCmp(arg, "-help") == 0 ||
                    JLI_StrCmp(arg, "-h") == 0 ||
                    JLI_StrCmp(arg, "-?") == 0) {
             printUsage = JNI_TRUE;
@@ -1282,7 +1433,7 @@
         }
     }
 
-    if (--argc >= 0) {
+    if (*pwhat == NULL && --argc >= 0) {
         *pwhat = *argv++;
     }
 
@@ -1692,7 +1843,7 @@
 ListModules(JNIEnv *env, char *optString)
 {
     jmethodID listModulesID;
-    jstring joptString;
+    jstring joptString = NULL;
     jclass cls = GetLauncherHelperClass(env);
     NULL_CHECK(cls);
     NULL_CHECK(listModulesID = (*env)->GetStaticMethodID(env, cls,
--- a/jdk/src/java.base/share/native/libjli/java.h	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/src/java.base/share/native/libjli/java.h	Wed Aug 10 15:51:25 2016 -0700
@@ -161,6 +161,7 @@
 jint ReadKnownVMs(const char *jvmcfg, jboolean speculative);
 char *CheckJvmType(int *argc, char ***argv, jboolean speculative);
 void AddOption(char *str, void *info);
+jboolean IsWhiteSpaceOption(const char* name);
 
 enum ergo_policy {
    DEFAULT_POLICY = 0,
--- a/jdk/src/jdk.jartool/share/classes/sun/tools/jar/GNUStyleOptions.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/GNUStyleOptions.java	Wed Aug 10 15:51:25 2016 -0700
@@ -91,7 +91,7 @@
                     tool.xflag = true;
                 }
             },
-            new Option(false, OptionType.MAIN_OPERATION, "--print-module-descriptor", "-p") {
+            new Option(false, OptionType.MAIN_OPERATION, "--print-module-descriptor", "-d") {
                 void process(Main tool, String opt, String arg) throws BadArgs {
                     if (tool.cflag || tool.iflag  || tool.tflag || tool.uflag || tool.xflag)
                         throw new BadArgs("error.multiple.main.operations").showUsage(true);
@@ -145,7 +145,7 @@
                     }
                 }
             },
-            new Option(true, OptionType.CREATE_UPDATE, "--modulepath", "--mp") {
+            new Option(true, OptionType.CREATE_UPDATE, "--module-path", "-p") {
                 void process(Main jartool, String opt, String arg) {
                     String[] dirs = arg.split(File.pathSeparator);
                     Path[] paths = new Path[dirs.length];
--- a/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar.properties	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar.properties	Wed Aug 10 15:51:25 2016 -0700
@@ -201,7 +201,7 @@
 main.help.opt.main.extract=\
 \  -x, --extract              Extract named (or all) files from the archive
 main.help.opt.main.print-module-descriptor=\
-\  -p, --print-module-descriptor  Print the module descriptor
+\  -d, --print-module-descriptor  Print the module descriptor
 main.help.opt.any=\
 \ Operation modifiers valid in any mode:\n\
 \n\
@@ -232,8 +232,8 @@
 \                             matched by the given pattern and that depend upon\n\
 \                             directly or indirectly on a modular jar being\n\
 \                             created or a non-modular jar being updated
-main.help.opt.create.update.modulepath=\
-\      --modulepath           Location of module dependence for generating
+main.help.opt.create.update.module-path=\
+\  -p, --module-path          Location of module dependence for generating\n\
 \                             the hash
 main.help.opt.create.update.index=\
 \ Operation modifiers valid only in create, update, and generate-index mode:\n
@@ -250,7 +250,7 @@
 \ located in the root of the given directories, or the root of the jar archive\n\
 \ itself. The following operations are only valid when creating a modular jar,\n\
 \ or updating an existing non-modular jar: '--module-version',\n\
-\ '--hash-modules', and '--modulepath'.\n\
+\ '--hash-modules', and '--module-path'.\n\
 \n\
 \ Mandatory or optional arguments to long options are also mandatory or optional\n\
-\ for any corresponding short options.
\ No newline at end of file
+\ for any corresponding short options.
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jimage/JImageTask.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jimage/JImageTask.java	Wed Aug 10 15:51:25 2016 -0700
@@ -61,11 +61,11 @@
 
         new Option<JImageTask>(false, (task, option, arg) -> {
             task.options.fullVersion = true;
-        }, true, "--fullversion"),
+        }, true, "--full-version"),
 
         new Option<JImageTask>(false, (task, option, arg) -> {
             task.options.help = true;
-        }, "--help"),
+        }, "--help", "-h"),
 
         new Option<JImageTask>(false, (task, option, arg) -> {
             task.options.verbose = true;
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jimage/resources/jimage.properties	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jimage/resources/jimage.properties	Wed Aug 10 15:51:25 2016 -0700
@@ -25,7 +25,7 @@
 
 main.usage.summary=\
 Usage: {0} <extract | info | list | verify> <options> jimage...\n\
-use --help for a list of possible options.
+use -h or --help for a list of possible options.
 
 main.usage=\
 Usage: {0} <extract | info | list | verify> <options> jimage...\n\
@@ -76,11 +76,11 @@
 \ used, one pattern per line\n\
 
 
-main.opt.fullversion=\
-\  --fullversion                     Print full version information
+main.opt.full-version=\
+\  --full-version                    Print full version information
 
 main.opt.help=\
-\  --help                            Print usage message
+\  -h,  --help                       Print usage message
 
 main.opt.verbose=\
 \  --verbose                         Listing prints entry size and offset attributes
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java	Wed Aug 10 15:51:25 2016 -0700
@@ -84,31 +84,32 @@
     private static final Option<?>[] recognizedOptions = {
         new Option<JlinkTask>(false, (task, opt, arg) -> {
             task.options.help = true;
-        }, "--help"),
+        }, "--help", "-h"),
         new Option<JlinkTask>(true, (task, opt, arg) -> {
             String[] dirs = arg.split(File.pathSeparator);
+            int i = 0;
             Arrays.stream(dirs)
                   .map(Paths::get)
                   .forEach(task.options.modulePath::add);
-        }, "--modulepath", "--mp"),
+        }, "--module-path", "-p"),
         new Option<JlinkTask>(true, (task, opt, arg) -> {
             for (String mn : arg.split(",")) {
                 if (mn.isEmpty()) {
                     throw taskHelper.newBadArgs("err.mods.must.be.specified",
-                            "--limitmods");
+                            "--limit-modules");
                 }
                 task.options.limitMods.add(mn);
             }
-        }, "--limitmods"),
+        }, "--limit-modules"),
         new Option<JlinkTask>(true, (task, opt, arg) -> {
             for (String mn : arg.split(",")) {
                 if (mn.isEmpty()) {
                     throw taskHelper.newBadArgs("err.mods.must.be.specified",
-                            "--addmods");
+                            "--add-modules");
                 }
                 task.options.addMods.add(mn);
             }
-        }, "--addmods"),
+        }, "--add-modules"),
         new Option<JlinkTask>(true, (task, opt, arg) -> {
             Path path = Paths.get(arg);
             task.options.output = path;
@@ -134,10 +135,10 @@
         }, true, "--keep-packaged-modules"),
         new Option<JlinkTask>(true, (task, opt, arg) -> {
             task.options.saveoptsfile = arg;
-        }, "--saveopts"),
+        }, "--save-opts"),
         new Option<JlinkTask>(false, (task, opt, arg) -> {
             task.options.fullVersion = true;
-        }, true, "--fullversion"),};
+        }, true, "--full-version"),};
 
     private static final String PROGNAME = "jlink";
     private final OptionsValues options = new OptionsValues();
@@ -294,7 +295,7 @@
         try {
             options.addMods = checkAddMods(options.addMods);
         } catch (IllegalArgumentException ex) {
-            throw taskHelper.newBadArgs("err.mods.must.be.specified", "--addmods")
+            throw taskHelper.newBadArgs("err.mods.must.be.specified", "--add-modules")
                     .showUsage(true);
         }
         // First create the image provider
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java	Wed Aug 10 15:51:25 2016 -0700
@@ -196,7 +196,7 @@
                         // This option is handled prior
                         // to have the options parsed.
                     },
-                    "--plugins-modulepath"));
+                    "--plugin-module-path"));
             mainOptions.add(new PlugOption(true, (task, opt, arg) -> {
                 Path path = Paths.get(arg);
                 if (!Files.exists(path) || !Files.isDirectory(path)) {
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink.properties	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink.properties	Wed Aug 10 15:51:25 2016 -0700
@@ -24,30 +24,31 @@
 #
 
 main.usage.summary=\
-Usage: {0} <options> --modulepath <modulepath> --addmods <mods> --output <path>\n\
+Usage: {0} <options> --module-path <modulepath> --add-modules <mods> --output <path>\n\
 use --help for a list of possible options
 
 main.usage=\
-Usage: {0} <options> --modulepath <modulepath> --addmods <mods> --output <path>\n\
+Usage: {0} <options> --module-path <modulepath> --add-modules <mods> --output <path>\n\
 \Possible options include:
 
 error.prefix=Error:
 warn.prefix=Warning:
 
 main.opt.help=\
-\  --help                            Print this help message
+\  -h, --help                        Print this help message
 
 main.opt.version=\
 \  --version                         Version information
 
-main.opt.modulepath=\
-\  --modulepath <modulepath>         Module path
+main.opt.module-path=\
+\  -p <modulepath>\n\
+\  --module-path <modulepath>        Module path
 
-main.opt.addmods=\
-\  --addmods <mod>[,<mod>...]        Root modules to resolve
+main.opt.add-modules=\
+\  --add-modules <mod>[,<mod>...]    Root modules to resolve
 
-main.opt.limitmods=\
-\  --limitmods <mod>[,<mod>...]      Limit the universe of observable modules
+main.opt.limit-modules=\
+\  --limit-modules <mod>[,<mod>...]  Limit the universe of observable modules
 
 main.opt.output=\
 \  --output <path>                   Location of output path
@@ -58,8 +59,8 @@
 main.opt.endian=\
 \  --endian <little|big>             Byte order of generated jimage (default:native)
 
-main.opt.saveopts=\
-\  --saveopts <filename>             Save jlink options in the given file
+main.opt.save-opts=\
+\  --save-opts <filename>            Save jlink options in the given file
 
 main.msg.bug=\
 An exception has occurred in jlink. \
@@ -83,7 +84,7 @@
 
 err.unknown.byte.order:unknown byte order {0}
 err.output.must.be.specified:--output must be specified
-err.modulepath.must.be.specified:--modulepath must be specified
+err.modulepath.must.be.specified:--module-path must be specified
 err.mods.must.be.specified:no modules specified to {0}
 err.path.not.found=path not found: {0}
 err.path.not.valid=invalid path: {0}
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/plugins.properties	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/plugins.properties	Wed Aug 10 15:51:25 2016 -0700
@@ -115,7 +115,7 @@
 Invalid language tag: %s
 
 include-locales.localedatanotfound=\
-jdk.localedata module was not specified with --addmods option
+jdk.localedata module was not specified with --add-modules option
 
 main.status.ok=Functional.
 
@@ -133,8 +133,8 @@
 plugin.opt.resources-last-sorter=\
 \  --resources-last-sorter <name>    The last plugin allowed to sort resources
 
-plugin.opt.plugins-modulepath=\
-\  --plugin-module-path <modulepath> Custom plugins module path
+plugin.opt.plugin-module-path=\
+\  --plugin-module-path <modulepath> Custom plugin module path
 
 plugin.opt.c=\
 \  -c, --compress=2                  Enable compression of resources (level 2)
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jmod/JmodTask.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jmod/JmodTask.java	Wed Aug 10 15:51:25 2016 -0700
@@ -1181,7 +1181,7 @@
         }
     }
 
-    private final OptionParser parser = new OptionParser();
+    private final OptionParser parser = new OptionParser("hp");
 
     private void handleOptions(String[] args) {
         parser.formatHelpWith(new JmodHelpFormatter());
@@ -1218,7 +1218,7 @@
                         .withValuesConvertedBy(new PatternConverter());
 
         OptionSpec<Void> help
-                = parser.accepts("help", getMessage("main.opt.help"))
+                = parser.acceptsAll(Set.of("h", "help"), getMessage("main.opt.help"))
                         .forHelp();
 
         OptionSpec<Path> libs
@@ -1232,9 +1232,9 @@
                         .withRequiredArg()
                         .describedAs(getMessage("main.opt.main-class.arg"));
 
-        OptionSpec<Path> modulePath  // TODO: short version of --mp ??
-                = parser.acceptsAll(Arrays.asList("mp", "modulepath"),
-                                    getMessage("main.opt.modulepath"))
+        OptionSpec<Path> modulePath
+                = parser.acceptsAll(Set.of("p", "module-path"),
+                                    getMessage("main.opt.module-path"))
                         .withRequiredArg()
                         .withValuesSeparatedBy(File.pathSeparatorChar)
                         .withValuesConvertedBy(DirPathConverter.INSTANCE);
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jmod/resources/jmod.properties	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jmod/resources/jmod.properties	Wed Aug 10 15:51:25 2016 -0700
@@ -63,7 +63,7 @@
 main.opt.os-arch.arg=os-arch
 main.opt.os-version=Operating system version
 main.opt.os-version.arg=os-version
-main.opt.modulepath=Module path
+main.opt.module-path=Module path
 main.opt.hash-modules=Compute and record hashes to tie a packaged module\
 \ with modules matching the given <regex-pattern> and depending upon it directly\
 \ or indirectly. The hashes are recorded in the JMOD file being created, or\
--- a/jdk/test/ProblemList.txt	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/ProblemList.txt	Wed Aug 10 15:51:25 2016 -0700
@@ -343,6 +343,9 @@
 
 com/sun/jdi/sde/SourceDebugExtensionTest.java                   8158066 windows-all
 
+com/sun/jdi/ClassesByName2Test.java				8160833 generic-all
+com/sun/jdi/RedefineCrossEvent.java				8160833 generic-all
+
 ############################################################################
 
 # jdk_time
--- a/jdk/test/TEST.ROOT	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/TEST.ROOT	Wed Aug 10 15:51:25 2016 -0700
@@ -26,12 +26,12 @@
 # Allow querying of various System properties in @requires clauses
 requires.properties=sun.arch.data.model java.runtime.name
 
-# Tests using jtreg 4.2 b02 features
-requiredVersion=4.2 b02
+# Tests using jtreg 4.2 b03 features
+requiredVersion=4.2 b03
 
 # Path to libraries in the topmost test directory. This is needed so @library
 # does not need ../../ notation to reach them
 external.lib.roots = ../../
 
-# Use new form of -Xpatch
-useNewXpatch=true
+# Use new module options
+useNewOptions=true
--- a/jdk/test/com/sun/corba/5036554/TestCorbaBug.sh	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/com/sun/corba/5036554/TestCorbaBug.sh	Wed Aug 10 15:51:25 2016 -0700
@@ -81,9 +81,9 @@
 
 chmod -fR 777 bug
 
-${COMPILEJAVA}${FS}bin${FS}javac -addmods java.corba -d . bug${FS}*.java
+${COMPILEJAVA}${FS}bin${FS}javac --add-modules java.corba -d . bug${FS}*.java
 
-${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -addmods java.corba -cp . bug/JavaBug > test.out 2>&1 
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} --add-modules java.corba -cp . bug/JavaBug > test.out 2>&1 
 
 grep "NullPointerException" test.out
 
--- a/jdk/test/com/sun/corba/7130985/CorbaExceptionsCompileTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/com/sun/corba/7130985/CorbaExceptionsCompileTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -27,8 +27,8 @@
  * @summary Four helper classes missing in Sun JDK
  * @library /lib/testlibrary
  * @build jdk.testlibrary.*
- * @compile -addmods java.corba CorbaExceptionsCompileTest.java
- * @run main/othervm -addmods java.corba CorbaExceptionsCompileTest
+ * @modules java.corba
+ * @run main CorbaExceptionsCompileTest
  */
 
 import java.io.*;
--- a/jdk/test/com/sun/corba/se/impl/io/HookPutFieldsTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/com/sun/corba/se/impl/io/HookPutFieldsTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -25,8 +25,8 @@
  * @test
  * @bug 7095856
  * @summary OutputStreamHook doesn't handle null values
- * @compile -addmods java.corba HookPutFieldsTest.java
- * @run main/othervm -addmods java.corba HookPutFieldsTest
+ * @modules java.corba
+ * @run main HookPutFieldsTest
  */
 
 import java.net.InetAddress;
--- a/jdk/test/com/sun/corba/se/impl/orb/SetDefaultORBTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/com/sun/corba/se/impl/orb/SetDefaultORBTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -25,8 +25,8 @@
  * @test
  * @bug 8028215
  * @summary SetDefaultORBTest setting ORB impl via properties test
- * @compile -addmods java.corba SetDefaultORBTest.java
- * @run main/othervm -addmods java.corba SetDefaultORBTest
+ * @modules java.corba
+ * @run main SetDefaultORBTest
  *
  */
 
--- a/jdk/test/com/sun/jdi/ImmutableResourceTest.sh	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/com/sun/jdi/ImmutableResourceTest.sh	Wed Aug 10 15:51:25 2016 -0700
@@ -99,11 +99,11 @@
 set -vx
 #
 # Compile test class
-${TESTJAVA}/bin/javac -XaddExports:jdk.jdi/com.sun.tools.example.debug.tty=ALL-UNNAMED \
+${TESTJAVA}/bin/javac --add-exports jdk.jdi/com.sun.tools.example.debug.tty=ALL-UNNAMED \
    -d "${TESTCLASSES}" ${CP} -g "${TESTSRC}"/"${TARGETCLASS}".java
 #
 # Run the test class, again with the classpath we need:
-${TESTJAVA}/bin/java -XaddExports:jdk.jdi/com.sun.tools.example.debug.tty=ALL-UNNAMED \
+${TESTJAVA}/bin/java --add-exports jdk.jdi/com.sun.tools.example.debug.tty=ALL-UNNAMED \
     ${CP} ${TARGETCLASS}
 status=$?
 echo "test status was: $status"
--- a/jdk/test/com/sun/jndi/cosnaming/CNNameParser.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/com/sun/jndi/cosnaming/CNNameParser.java	Wed Aug 10 15:51:25 2016 -0700
@@ -26,6 +26,7 @@
  * @summary Tests that JNDI/COS naming parser supports the syntax
  * defined in the new INS standard.
  * @modules java.corba/com.sun.jndi.cosnaming
+ * @run main/othervm CNNameParser
  */
 
 import javax.naming.*;
--- a/jdk/test/com/sun/jndi/cosnaming/IiopUrlIPv6.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/com/sun/jndi/cosnaming/IiopUrlIPv6.java	Wed Aug 10 15:51:25 2016 -0700
@@ -25,6 +25,7 @@
  * @bug 5042453
  * @summary Ipv6 address throws Non-numeric port number error
  * @modules java.corba/com.sun.jndi.cosnaming
+ * @run main/othervm IiopUrlIPv6
  */
 
 import com.sun.jndi.cosnaming.*;
--- a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java	Wed Aug 10 15:51:25 2016 -0700
@@ -61,7 +61,7 @@
 
             ProcessBuilder pb = ProcessTools.
                 createJavaProcessBuilder(
-                    "-XaddExports:jdk.attach/sun.tools.attach=ALL-UNNAMED",
+                    "--add-exports", "jdk.attach/sun.tools.attach=ALL-UNNAMED",
                     "-XX:+UseConcMarkSweepGC",  // this will cause UseParNewGC to be FLAG_SET_ERGO
                     "-XX:+UseCodeAging",
                     "-XX:+UseCerealGC",         // Should be ignored.
--- a/jdk/test/java/awt/Gtk/GtkVersionTest/GtkVersionTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/awt/Gtk/GtkVersionTest/GtkVersionTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -55,7 +55,7 @@
                 "/bin/java " +
                 (version == null ? "" : "-Djdk.gtk.version=" + version) +
                 " -Djdk.gtk.verbose=true " +
-                "-XaddExports:java.desktop/sun.awt=ALL-UNNAMED " +
+                "--add-exports=java.desktop/sun.awt=ALL-UNNAMED " +
                 "-cp " + System.getProperty("java.class.path", ".") +
                 " GtkVersionTest$LoadGtk");
         p.waitFor();
--- a/jdk/test/java/awt/Toolkit/Headless/WrappedToolkitTest/WrappedToolkitTest.sh	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/awt/Toolkit/Headless/WrappedToolkitTest/WrappedToolkitTest.sh	Wed Aug 10 15:51:25 2016 -0700
@@ -113,8 +113,8 @@
 case "$OS" in
   Windows* | CYGWIN* )
     ${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} \
-                         -XaddExports:java.desktop/sun.awt=ALL-UNNAMED \
-                         -XaddExports:java.desktop/sun.awt.windows=ALL-UNNAMED ${CP} \
+                         --add-exports java.desktop/sun.awt=ALL-UNNAMED \
+                         --add-exports java.desktop/sun.awt.windows=ALL-UNNAMED ${CP} \
                          *.java
     status=$?
     if [ ! $status -eq "0" ]; then
@@ -124,8 +124,8 @@
 
   SunOS | Linux )
     ${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} \
-                         -XaddExports:java.desktop/sun.awt=ALL-UNNAMED \
-                         -XaddExports:java.desktop/sun.awt.X11=ALL-UNNAMED ${CP} \
+                         --add-exports java.desktop/sun.awt=ALL-UNNAMED \
+                         --add-exports java.desktop/sun.awt.X11=ALL-UNNAMED ${CP} \
                          *.java
     status=$?
     if [ ! $status -eq "0" ]; then
@@ -135,8 +135,8 @@
 
   Darwin)
     ${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} \
-                         -XaddExports:java.desktop/sun.awt=ALL-UNNAMED \
-                         -XaddExports:java.desktop/sun.lwawt.macosx=ALL-UNNAMED ${CP} \
+                         --add-exports java.desktop/sun.awt=ALL-UNNAMED \
+                         --add-exports java.desktop/sun.lwawt.macosx=ALL-UNNAMED ${CP} \
                          *.java
     status=$?
     if [ ! $status -eq "0" ]; then
@@ -154,16 +154,16 @@
 case "$OS" in
   Windows* | CYGWIN* )
     ${TESTJAVA}/bin/java ${TESTVMOPTS} -Djava.awt.headless=true \
-                         -XaddExports:java.desktop/sun.awt=ALL-UNNAMED \
-                         -XaddExports:java.desktop/sun.awt.windows=ALL-UNNAMED ${CP} \
+                         --add-exports java.desktop/sun.awt=ALL-UNNAMED \
+                         --add-exports java.desktop/sun.awt.windows=ALL-UNNAMED ${CP} \
                          TestWrapped sun.awt.windows.WToolkit
     status=$?
     if [ ! $status -eq "0" ]; then
       fail "Test FAILED: toolkit wrapped into HeadlessToolkit is not an instance of sun.awt.windows.WToolkit";
     fi
     ${TESTJAVA}/bin/java ${TESTVMOPTS} -Djava.awt.headless=true \
-                         -XaddExports:java.desktop/sun.awt=ALL-UNNAMED \
-                         -XaddExports:java.desktop/sun.awt.windows=ALL-UNNAMED ${CP} \
+                         --add-exports java.desktop/sun.awt=ALL-UNNAMED \
+                         --add-exports java.desktop/sun.awt.windows=ALL-UNNAMED ${CP} \
                          -Dawt.toolkit=sun.awt.windows.WToolkit \
                          TestWrapped sun.awt.windows.WToolkit
     status=$?
@@ -174,8 +174,8 @@
 
   SunOS | Linux )
     ${TESTJAVA}/bin/java ${TESTVMOPTS} -Djava.awt.headless=true \
-                         -XaddExports:java.desktop/sun.awt=ALL-UNNAMED \
-                         -XaddExports:java.desktop/sun.awt.X11=ALL-UNNAMED ${CP} \
+                         --add-exports java.desktop/sun.awt=ALL-UNNAMED \
+                         --add-exports java.desktop/sun.awt.X11=ALL-UNNAMED ${CP} \
                          -Dawt.toolkit=sun.awt.X11.XToolkit \
                          TestWrapped sun.awt.X11.XToolkit
     status=$?
@@ -183,8 +183,8 @@
       fail "Test FAILED: toolkit wrapped into HeadlessToolkit is not an instance of sun.awt.xawt.XToolkit";
     fi
     AWT_TOOLKIT=XToolkit ${TESTJAVA}/bin/java ${TESTVMOPTS} \
-                         -XaddExports:java.desktop/sun.awt=ALL-UNNAMED \
-                         -XaddExports:java.desktop/sun.awt.X11=ALL-UNNAMED ${CP} \
+                         --add-exports java.desktop/sun.awt=ALL-UNNAMED \
+                         --add-exports java.desktop/sun.awt.X11=ALL-UNNAMED ${CP} \
                                               -Djava.awt.headless=true \
                                               TestWrapped sun.awt.X11.XToolkit
     status=$?
@@ -195,16 +195,16 @@
 
   Darwin)
     ${TESTJAVA}/bin/java ${TESTVMOPTS} -Djava.awt.headless=true \
-                         -XaddExports:java.desktop/sun.awt=ALL-UNNAMED \
-                         -XaddExports:java.desktop/sun.lwawt.macosx=ALL-UNNAMED ${CP} \
+                         --add-exports java.desktop/sun.awt=ALL-UNNAMED \
+                         --add-exports java.desktop/sun.lwawt.macosx=ALL-UNNAMED ${CP} \
                          TestWrapped sun.lwawt.macosx.LWCToolkit
     status=$?
     if [ ! $status -eq "0" ]; then
       fail "Test FAILED: toolkit wrapped into HeadlessToolkit is not an instance of sun.lwawt.macosx.LWCToolkit";
     fi
     ${TESTJAVA}/bin/java ${TESTVMOPTS} -Djava.awt.headless=true \
-                         -XaddExports:java.desktop/sun.awt=ALL-UNNAMED \
-                         -XaddExports:java.desktop/sun.lwawt.macosx=ALL-UNNAMED ${CP} \
+                         --add-exports java.desktop/sun.awt=ALL-UNNAMED \
+                         --add-exports java.desktop/sun.lwawt.macosx=ALL-UNNAMED ${CP} \
                          -Dawt.toolkit=sun.lwawt.macosx.LWCToolkit \
                          TestWrapped sun.lwawt.macosx.LWCToolkit
     status=$?
--- a/jdk/test/java/awt/xembed/server/RunTestXEmbed.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/awt/xembed/server/RunTestXEmbed.java	Wed Aug 10 15:51:25 2016 -0700
@@ -73,10 +73,11 @@
                     enva[ind++] = "AWT_TOOLKIT=sun.awt.X11.XToolkit";
                 }
             }
-            Process proc = Runtime.getRuntime().exec(java_home +
-                                                     "/bin/java -XaddExports:java.desktop/sun.awt.X11=ALL-UNNAMED -Dawt.toolkit=sun.awt.X11.XToolkit TesterClient "
-                                                     + test.getName() + " " + window + buf,
-                                                     enva);
+            Process proc = Runtime.getRuntime().
+                exec(java_home +
+                     "/bin/java --add-exports java.desktop/sun.awt.X11=ALL-UNNAMED -Dawt.toolkit=sun.awt.X11.XToolkit TesterClient "
+                     + test.getName() + " " + window + buf,
+                     enva);
             System.err.println("Test for " + test.getName() + " has started.");
             log.fine("Test for " + test.getName() + " has started.");
             new InputReader(proc.getInputStream());
--- a/jdk/test/java/awt/xembed/server/TestXEmbedServerJava.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/awt/xembed/server/TestXEmbedServerJava.java	Wed Aug 10 15:51:25 2016 -0700
@@ -84,11 +84,11 @@
             }
             if (hasModules) {
                 System.out.println(java_home +
-                               "/bin/java  -XaddExports:java.desktop/sun.awt.X11=ALL-UNNAMED "+
-                               "-XaddExports:java.desktop/sun.awt=ALL-UNNAMED  JavaClient " + window);
+                               "/bin/java --add-exports java.desktop/sun.awt.X11=ALL-UNNAMED "+
+                               "--add-exports java.desktop/sun.awt=ALL-UNNAMED  JavaClient " + window);
                 return Runtime.getRuntime().exec(java_home +
-                               "/bin/java  -XaddExports:java.desktop/sun.awt.X11=ALL-UNNAMED "+
-                               "-XaddExports:java.desktop/sun.awt=ALL-UNNAMED  JavaClient " + window);
+                               "/bin/java --add-exports java.desktop/sun.awt.X11=ALL-UNNAMED "+
+                               "--add-exports java.desktop/sun.awt=ALL-UNNAMED  JavaClient " + window);
             }else{
                 System.out.println(java_home + "/bin/java JavaClient " + window);
                 return Runtime.getRuntime().exec(java_home + "/bin/java JavaClient " + window);
--- a/jdk/test/java/beans/XMLDecoder/8028054/TestConstructorFinder.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/beans/XMLDecoder/8028054/TestConstructorFinder.java	Wed Aug 10 15:51:25 2016 -0700
@@ -39,7 +39,7 @@
  *          java.corba
  *          java.xml.bind
  * @compile -XDignore.symbol.file TestConstructorFinder.java
- * @run main/othervm -addmods java.activation -addmods java.transaction -addmods java.corba -addmods java.xml.bind TestConstructorFinder
+ * @run main/othervm --add-modules=java.activation,java.transaction,java.corba,java.xml.bind TestConstructorFinder
  */
 
 public class TestConstructorFinder {
--- a/jdk/test/java/beans/XMLDecoder/8028054/TestMethodFinder.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/beans/XMLDecoder/8028054/TestMethodFinder.java	Wed Aug 10 15:51:25 2016 -0700
@@ -39,7 +39,7 @@
  *          java.corba
  *          java.xml.bind
  * @compile -XDignore.symbol.file TestMethodFinder.java
- * @run main/othervm -addmods java.activation -addmods java.transaction -addmods java.corba -addmods java.xml.bind TestMethodFinder
+ * @run main/othervm --add-modules=java.activation,java.transaction,java.corba,java.xml.bind TestMethodFinder
  */
 
 public class TestMethodFinder {
--- a/jdk/test/java/lang/Class/forName/modules/TestDriver.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/lang/Class/forName/modules/TestDriver.java	Wed Aug 10 15:51:25 2016 -0700
@@ -65,7 +65,7 @@
     public void setup() throws Exception {
         assertTrue(CompilerUtils.compile(
                         MOD_SRC_DIR, MOD_DEST_DIR,
-                        "-modulesourcepath",
+                        "--module-source-path",
                         MOD_SRC_DIR.toString()));
 
         copyDirectories(MOD_DEST_DIR.resolve("m1"), Paths.get("mods1"));
@@ -76,8 +76,8 @@
     public void test() throws Exception {
         String[] options = new String[] {
                 "-cp", TEST_CLASSES,
-                "-mp", MOD_DEST_DIR.toString(),
-                "-addmods", String.join(",", modules),
+                "--module-path", MOD_DEST_DIR.toString(),
+                "--add-modules", String.join(",", modules),
                 "-m", "m2/p2.test.Main"
         };
         runTest(options);
@@ -87,8 +87,8 @@
     public void testUnnamedModule() throws Exception {
         String[] options = new String[] {
                 "-cp", TEST_CLASSES,
-                "-mp", MOD_DEST_DIR.toString(),
-                "-addmods", String.join(",", modules),
+                "--module-path", MOD_DEST_DIR.toString(),
+                "--add-modules", String.join(",", modules),
                 "TestMain"
         };
         runTest(options);
@@ -107,8 +107,8 @@
     @Test
     public void testDeniedClassLoaderAccess() throws Exception {
         String[] options = new String[] {
-                "-mp", MOD_DEST_DIR.toString(),
-                "-addmods", String.join(",", modules),
+                "--module-path", MOD_DEST_DIR.toString(),
+                "--add-modules", String.join(",", modules),
                 "-m", "m3/p3.NoGetClassLoaderAccess"
         };
         assertTrue(executeTestJava(options)
@@ -124,8 +124,8 @@
         String[] options = new String[] {
                 "-Djava.security.manager",
                 "-Djava.security.policy=" + policyFile.toString(),
-                "-mp", MOD_DEST_DIR.toString(),
-                "-addmods", String.join(",", modules),
+                "--module-path", MOD_DEST_DIR.toString(),
+                "--add-modules", String.join(",", modules),
                 "-m", "m3/p3.NoAccess"
         };
         assertTrue(executeTestJava(options)
--- a/jdk/test/java/lang/Class/getDeclaredField/FieldSetAccessibleTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/lang/Class/getDeclaredField/FieldSetAccessibleTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -63,8 +63,8 @@
  *          loads all the classes in the BCL, get their declared fields,
  *          and call setAccessible(false) followed by setAccessible(true);
  * @modules java.base/jdk.internal.module
- * @run main/othervm -Djdk.launcher.addmods=ALL-SYSTEM FieldSetAccessibleTest UNSECURE
- * @run main/othervm -Djdk.launcher.addmods=ALL-SYSTEM FieldSetAccessibleTest SECURE
+ * @run main/othervm --add-modules=ALL-SYSTEM FieldSetAccessibleTest UNSECURE
+ * @run main/othervm --add-modules=ALL-SYSTEM FieldSetAccessibleTest SECURE
  *
  * @author danielfuchs
  */
--- a/jdk/test/java/lang/Class/getResource/ResourcesTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/lang/Class/getResource/ResourcesTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -60,15 +60,15 @@
         compiled = CompilerUtils
             .compile(SRC_DIR,
                      MODS_DIR,
-                     "-modulesourcepath", SRC_DIR.toString());
+                     "--module-source-path", SRC_DIR.toString());
         assertTrue(compiled);
 
-        // javac -mp mods -d classes Main.java
+        // javac --module-path mods -d classes Main.java
         compiled = CompilerUtils
             .compile(Paths.get(TEST_SRC, "Main.java"),
                      CLASSES_DIR,
-                     "-mp", MODS_DIR.toString(),
-                     "-addmods", "m1,m2,m3");
+                     "--module-path", MODS_DIR.toString(),
+                     "--add-modules", "m1,m2,m3");
         assertTrue(compiled);
 
     }
@@ -79,8 +79,8 @@
     public void runTest() throws Exception {
 
         int exitValue
-            = executeTestJava("-mp", MODS_DIR.toString(),
-                              "-addmods", "m1,m2,m3",
+            = executeTestJava("--module-path", MODS_DIR.toString(),
+                              "--add-modules", "m1,m2,m3",
                                "-cp", CLASSES_DIR.toString(),
                               "Main")
                 .outputTo(System.out)
--- a/jdk/test/java/lang/ClassLoader/getResource/modules/ResourcesTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/lang/ClassLoader/getResource/modules/ResourcesTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -56,19 +56,19 @@
     public void compileAll() throws Exception {
         boolean compiled;
 
-        // javac -modulesource mods -d mods src/**
+        // javac --module-source-path mods -d mods src/**
         compiled = CompilerUtils
             .compile(SRC_DIR,
                      MODS_DIR,
-                     "-modulesourcepath", SRC_DIR.toString());
+                     "--module-source-path", SRC_DIR.toString());
         assertTrue(compiled);
 
-        // javac -mp mods -d classes Main.java
+        // javac --module-path mods -d classes Main.java
         compiled = CompilerUtils
             .compile(Paths.get(TEST_SRC, "Main.java"),
                      CLASSES_DIR,
-                     "-mp", MODS_DIR.toString(),
-                     "-addmods", "m1,m2,m3");
+                     "--module-path", MODS_DIR.toString(),
+                     "--add-modules", "m1,m2,m3");
         assertTrue(compiled);
     }
 
@@ -77,8 +77,8 @@
      */
     public void runTest() throws Exception {
         int exitValue
-            = executeTestJava("-mp", MODS_DIR.toString(),
-                              "-addmods", "m1,m2,m3",
+            = executeTestJava("--module-path", MODS_DIR.toString(),
+                              "--add-modules", "m1,m2,m3",
                                "-cp", CLASSES_DIR.toString(),
                               "Main")
                 .outputTo(System.out)
--- a/jdk/test/java/lang/SecurityManager/modules/CustomSecurityManager.sh	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/lang/SecurityManager/modules/CustomSecurityManager.sh	Wed Aug 10 15:51:25 2016 -0700
@@ -51,15 +51,15 @@
 JAVA="$TESTJAVA/bin/java ${TESTVMOPTS}"
 
 mkdir -p mods
-$JAVAC -d mods -modulesourcepath ${TESTSRC} `find ${TESTSRC}/m -name "*.java"`
+$JAVAC -d mods --module-source-path ${TESTSRC} `find ${TESTSRC}/m -name "*.java"`
 
 mkdir -p classes
 $JAVAC -d classes ${TESTSRC}/Test.java
 
-$JAVA -cp classes -mp mods -addmods m \
+$JAVA -cp classes --module-path mods --add-modules m \
     -Djava.security.manager \
     -Djava.security.policy=${TESTSRC}/test.policy Test
-$JAVA -cp classes -mp mods -addmods m \
+$JAVA -cp classes --module-path mods --add-modules m \
     -Djava.security.manager=p.CustomSecurityManager \
     -Djava.security.policy=${TESTSRC}/test.policy Test
 
--- a/jdk/test/java/lang/String/concat/WithSecurityManager.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/lang/String/concat/WithSecurityManager.java	Wed Aug 10 15:51:25 2016 -0700
@@ -38,13 +38,13 @@
  * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT      WithSecurityManager
  * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT  WithSecurityManager
  *
- * @run main/othervm -Xverify:all -limitmods java.base WithSecurityManager
- * @run main/othervm -Xverify:all -limitmods java.base -Djava.lang.invoke.stringConcat=BC_SB                  WithSecurityManager
- * @run main/othervm -Xverify:all -limitmods java.base -Djava.lang.invoke.stringConcat=BC_SB_SIZED            WithSecurityManager
- * @run main/othervm -Xverify:all -limitmods java.base -Djava.lang.invoke.stringConcat=MH_SB_SIZED            WithSecurityManager
- * @run main/othervm -Xverify:all -limitmods java.base -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT      WithSecurityManager
- * @run main/othervm -Xverify:all -limitmods java.base -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT      WithSecurityManager
- * @run main/othervm -Xverify:all -limitmods java.base -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT  WithSecurityManager
+ * @run main/othervm -Xverify:all --limit-modules=java.base WithSecurityManager
+ * @run main/othervm -Xverify:all --limit-modules=java.base -Djava.lang.invoke.stringConcat=BC_SB                  WithSecurityManager
+ * @run main/othervm -Xverify:all --limit-modules=java.base -Djava.lang.invoke.stringConcat=BC_SB_SIZED            WithSecurityManager
+ * @run main/othervm -Xverify:all --limit-modules=java.base -Djava.lang.invoke.stringConcat=MH_SB_SIZED            WithSecurityManager
+ * @run main/othervm -Xverify:all --limit-modules=java.base -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT      WithSecurityManager
+ * @run main/othervm -Xverify:all --limit-modules=java.base -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT      WithSecurityManager
+ * @run main/othervm -Xverify:all --limit-modules=java.base -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT  WithSecurityManager
 */
 public class WithSecurityManager {
     public static void main(String[] args) throws Throwable {
--- a/jdk/test/java/lang/instrument/MakeJAR2.sh	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/lang/instrument/MakeJAR2.sh	Wed Aug 10 15:51:25 2016 -0700
@@ -87,7 +87,7 @@
 cd ..
 
 ${JAVAC} ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \
-    -XaddExports:java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED ${AGENT}.java asmlib/*.java
+    --add-exports java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED ${AGENT}.java asmlib/*.java
 ${JAVAC} ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -classpath .${PATHSEP}bootpath ${APP}.java
 
 echo "Manifest-Version: 1.0"    >  ${AGENT}.mf
--- a/jdk/test/java/lang/invoke/modules/ModuleAccessControlTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/lang/invoke/modules/ModuleAccessControlTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -60,7 +60,7 @@
         for (String mn : modules) {
             Path msrc = SRC_DIR.resolve(mn);
             assertTrue(CompilerUtils
-                .compile(msrc, MODS_DIR, "-modulesourcepath", SRC_DIR.toString()));
+                .compile(msrc, MODS_DIR, "--module-source-path", SRC_DIR.toString()));
         }
     }
 
@@ -69,7 +69,7 @@
      */
     @Test
     public void runTest() throws Exception {
-        int exitValue = executeTestJava("-mp", MODS_DIR.toString(),
+        int exitValue = executeTestJava("--module-path", MODS_DIR.toString(),
                                         "-m", "m1/p1.Main")
                 .outputTo(System.out)
                 .errorTo(System.out)
--- a/jdk/test/java/lang/reflect/Layer/LayerAndLoadersTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/lang/reflect/Layer/LayerAndLoadersTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -63,9 +63,9 @@
     @BeforeTest
     public void setup() throws Exception {
 
-        // javac -d mods -modulesourcepath src src/**
+        // javac -d mods --module-source-path src src/**
         assertTrue(CompilerUtils.compile(SRC_DIR, MODS_DIR,
-                "-modulesourcepath", SRC_DIR.toString()));
+                "--module-source-path", SRC_DIR.toString()));
     }
 
 
--- a/jdk/test/java/lang/reflect/Layer/src/m1/module-info.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/lang/reflect/Layer/src/m1/module-info.java	Wed Aug 10 15:51:25 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/jdk/test/java/lang/reflect/Module/AddExportsTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/lang/reflect/Module/AddExportsTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -23,29 +23,44 @@
 
 /**
  * @test
- * @modules java.desktop
- * @run main/othervm -XaddExports:java.desktop/sun.awt=java.base AddExportsTest
- * @run main/othervm -XaddExports:java.desktop/sun.awt=ALL-UNNAMED AddExportsTest
+ * @modules java.base/jdk.internal.misc
+ *          java.desktop
+ * @run main/othervm --add-exports=java.desktop/sun.awt=java.base AddExportsTest
+ * @run main/othervm --add-exports=java.desktop/sun.awt=ALL-UNNAMED AddExportsTest
  * @summary Test Module isExported methods with exports changed by -AddExportsTest
  */
 
 import java.lang.reflect.Layer;
 import java.lang.reflect.Module;
 import java.util.Optional;
+import java.util.stream.Stream;
+
+import jdk.internal.misc.VM;
 
 public class AddExportsTest {
+    /*
+     * jtreg sets -Dtest.modules system property to the internal APIs
+     * specified at @modules tag.  The test will exclude --add-exports set
+     * for @modules.
+     */
+    private static final String TEST_MODULES = System.getProperty("test.modules");
 
     public static void main(String[] args) {
 
-        String addExports = System.getProperty("jdk.launcher.addexports.0");
-        assertTrue(addExports != null, "Expected to be run with -XaddExports");
+        Optional<String> oaddExports = Stream.of(VM.getRuntimeArguments())
+            .filter(arg -> arg.startsWith("--add-exports="))
+            .filter(arg -> !arg.equals("--add-exports=" + TEST_MODULES + "=ALL-UNNAMED"))
+            .map(arg -> arg.substring("--add-exports=".length(), arg.length()))
+            .findFirst();
+
+        assertTrue(oaddExports.isPresent());
 
         Layer bootLayer = Layer.boot();
 
         Module unnamedModule = AddExportsTest.class.getModule();
         assertFalse(unnamedModule.isNamed());
 
-        for (String expr : addExports.split(",")) {
+        for (String expr : oaddExports.get().split(",")) {
 
             String[] s = expr.split("=");
             assertTrue(s.length == 2);
--- a/jdk/test/java/lang/reflect/Module/access/AccessTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/lang/reflect/Module/access/AccessTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -72,8 +72,8 @@
      */
     public void runTest() throws Exception {
         int exitValue
-            = executeTestJava("-mp", MODS_DIR.toString(),
-                              "-addmods", "target",
+            = executeTestJava("--module-path", MODS_DIR.toString(),
+                              "--add-modules", "target",
                               "-m", "test/test.Main")
                 .outputTo(System.out)
                 .errorTo(System.out)
--- a/jdk/test/java/lang/reflect/Proxy/ProxyClassAccessTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/lang/reflect/Proxy/ProxyClassAccessTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -64,7 +64,7 @@
     public void compileAll() throws Exception {
         for (String mn : modules) {
             Path msrc = SRC_DIR.resolve(mn);
-            assertTrue(CompilerUtils.compile(msrc, MODS_DIR, "-modulesourcepath", SRC_DIR.toString()));
+            assertTrue(CompilerUtils.compile(msrc, MODS_DIR, "--module-source-path", SRC_DIR.toString()));
         }
     }
 
@@ -73,7 +73,7 @@
      */
     @Test
     public void runTest() throws Exception {
-        int exitValue = executeTestJava("-mp", MODS_DIR.toString(),
+        int exitValue = executeTestJava("--module-path", MODS_DIR.toString(),
                                         "-m", "test/jdk.test.ProxyClassAccess")
                             .outputTo(System.out)
                             .errorTo(System.out)
--- a/jdk/test/java/lang/reflect/Proxy/ProxyLayerTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/lang/reflect/Proxy/ProxyLayerTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -65,7 +65,7 @@
     public void compileAll() throws Exception {
         for (String mn : modules) {
             Path msrc = SRC_DIR.resolve(mn);
-            assertTrue(CompilerUtils.compile(msrc, MODS_DIR, "-modulesourcepath", SRC_DIR.toString()));
+            assertTrue(CompilerUtils.compile(msrc, MODS_DIR, "--module-source-path", SRC_DIR.toString()));
         }
     }
 
--- a/jdk/test/java/lang/reflect/Proxy/ProxyModuleMapping.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/lang/reflect/Proxy/ProxyModuleMapping.java	Wed Aug 10 15:51:25 2016 -0700
@@ -38,7 +38,7 @@
         Module unnamed = ld.getUnnamedModule();
         new ProxyModuleMapping(unnamed, Runnable.class).test();
 
-        // unnamed module gets access to sun.invoke package (e.g. via -XaddExports)
+        // unnamed module gets access to sun.invoke package (e.g. via --add-exports)
         new ProxyModuleMapping(sun.invoke.WrapperInstance.class).test();
 
         Class<?> modulePrivateIntf = Class.forName("sun.net.ProgressListener");
--- a/jdk/test/java/lang/reflect/Proxy/ProxyTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/lang/reflect/Proxy/ProxyTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -61,7 +61,7 @@
     public void compileAll() throws Exception {
         for (String mn : modules) {
             Path msrc = SRC_DIR.resolve(mn);
-            assertTrue(CompilerUtils.compile(msrc, MODS_DIR, "-modulesourcepath", SRC_DIR.toString()));
+            assertTrue(CompilerUtils.compile(msrc, MODS_DIR, "--module-source-path", SRC_DIR.toString()));
         }
     }
 
@@ -71,7 +71,7 @@
     @Test
     public void runTest() throws Exception {
         int exitValue = executeTestJava("-cp", CPATH_DIR.toString(),
-                                        "-mp", MODS_DIR.toString(),
+                                        "--module-path", MODS_DIR.toString(),
                                         "-m", "test/jdk.test.Main")
                             .outputTo(System.out)
                             .errorTo(System.out)
--- a/jdk/test/java/net/Authenticator/B4933582.sh	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/net/Authenticator/B4933582.sh	Wed Aug 10 15:51:25 2016 -0700
@@ -44,7 +44,7 @@
     ;;
 esac
 
-EXTRAOPTS="-XaddExports:java.base/sun.net.www=ALL-UNNAMED -XaddExports:java.base/sun.net.www.protocol.http=ALL-UNNAMED"
+EXTRAOPTS="--add-exports java.base/sun.net.www=ALL-UNNAMED --add-exports java.base/sun.net.www.protocol.http=ALL-UNNAMED"
 export EXTRAOPTS
 
 ${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} ${EXTRAOPTS} -d . \
--- a/jdk/test/java/net/SocketOption/OptionsTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/net/SocketOption/OptionsTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -26,7 +26,7 @@
  * @bug 8036979 8072384 8044773
  * @run main/othervm -Xcheck:jni OptionsTest
  * @run main/othervm -Xcheck:jni -Djava.net.preferIPv4Stack=true OptionsTest
- * @run main/othervm -limitmods java.base OptionsTest
+ * @run main/othervm --limit-modules=java.base OptionsTest
  */
 
 import java.lang.reflect.Method;
--- a/jdk/test/java/net/SocketOption/UnsupportedOptionsTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/net/SocketOption/UnsupportedOptionsTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -33,7 +33,7 @@
  * @summary Test checks that UnsupportedOperationException for unsupported
  * SOCKET_OPTIONS is thrown by both getOption() and setOption() methods.
  * @run main UnsupportedOptionsTest
- * @run main/othervm -limitmods java.base UnsupportedOptionsTest
+ * @run main/othervm --limit-modules=java.base UnsupportedOptionsTest
  */
 
 public class UnsupportedOptionsTest {
--- a/jdk/test/java/net/httpclient/http2/HpackDriver.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/net/httpclient/http2/HpackDriver.java	Wed Aug 10 15:51:25 2016 -0700
@@ -29,12 +29,12 @@
  * @compile/module=java.httpclient sun/net/httpclient/hpack/SpecHelper.java
  * @compile/module=java.httpclient sun/net/httpclient/hpack/TestHelper.java
  * @compile/module=java.httpclient sun/net/httpclient/hpack/BuffersTestingKit.java
- * @run testng/othervm -XaddReads:java.httpclient=ALL-UNNAMED java.httpclient/sun.net.httpclient.hpack.BinaryPrimitivesTest
- * @run testng/othervm -XaddReads:java.httpclient=ALL-UNNAMED java.httpclient/sun.net.httpclient.hpack.CircularBufferTest
- * @run testng/othervm -XaddReads:java.httpclient=ALL-UNNAMED java.httpclient/sun.net.httpclient.hpack.DecoderTest
- * @run testng/othervm -XaddReads:java.httpclient=ALL-UNNAMED java.httpclient/sun.net.httpclient.hpack.EncoderTest
- * @run testng/othervm -XaddReads:java.httpclient=ALL-UNNAMED java.httpclient/sun.net.httpclient.hpack.HeaderTableTest
- * @run testng/othervm -XaddReads:java.httpclient=ALL-UNNAMED java.httpclient/sun.net.httpclient.hpack.HuffmanTest
- * @run testng/othervm -XaddReads:java.httpclient=ALL-UNNAMED java.httpclient/sun.net.httpclient.hpack.TestHelper
+ * @run testng/othervm java.httpclient/sun.net.httpclient.hpack.BinaryPrimitivesTest
+ * @run testng/othervm java.httpclient/sun.net.httpclient.hpack.CircularBufferTest
+ * @run testng/othervm java.httpclient/sun.net.httpclient.hpack.DecoderTest
+ * @run testng/othervm java.httpclient/sun.net.httpclient.hpack.EncoderTest
+ * @run testng/othervm java.httpclient/sun.net.httpclient.hpack.HeaderTableTest
+ * @run testng/othervm java.httpclient/sun.net.httpclient.hpack.HuffmanTest
+ * @run testng/othervm java.httpclient/sun.net.httpclient.hpack.TestHelper
  */
 public class HpackDriver { }
--- a/jdk/test/java/nio/channels/DatagramChannel/SocketOptionTests.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/nio/channels/DatagramChannel/SocketOptionTests.java	Wed Aug 10 15:51:25 2016 -0700
@@ -25,7 +25,7 @@
  * @bug 4640544 8044773
  * @summary Unit test for setOption/getOption/options methods
  * @run main SocketOptionTests
- * @run main/othervm -limitmods java.base SocketOptionTests
+ * @run main/othervm --limit-modules=java.base SocketOptionTests
  */
 
 import java.nio.*;
--- a/jdk/test/java/nio/channels/ServerSocketChannel/SocketOptionTests.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/nio/channels/ServerSocketChannel/SocketOptionTests.java	Wed Aug 10 15:51:25 2016 -0700
@@ -26,7 +26,7 @@
  * @summary Unit test for ServerSocketChannel setOption/getOption/options
  *          methods.
  * @run main SocketOptionTests
- * @run main/othervm -limitmods java.base SocketOptionTests
+ * @run main/othervm --limit-modules=java.base SocketOptionTests
  */
 
 import java.nio.*;
--- a/jdk/test/java/nio/channels/SocketChannel/SocketOptionTests.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/nio/channels/SocketChannel/SocketOptionTests.java	Wed Aug 10 15:51:25 2016 -0700
@@ -26,7 +26,7 @@
  * @summary Unit test to check SocketChannel setOption/getOption/options
  *          methods.
  * @run main SocketOptionTests
- * @run main/othervm -limitmods java.base SocketOptionTests
+ * @run main/othervm --limit-modules=java.base SocketOptionTests
  */
 
 import java.nio.*;
--- a/jdk/test/java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh	Wed Aug 10 15:51:25 2016 -0700
@@ -109,7 +109,7 @@
 
 go() {
     echo ''
-    sh -xc "$JAVA ${TESTVMOPTS} -XaddExports:java.base/sun.nio.ch=ALL-UNNAMED $DFLAG \
+    sh -xc "$JAVA ${TESTVMOPTS} --add-exports java.base/sun.nio.ch=ALL-UNNAMED $DFLAG \
         $1 $2 $3 $4 $5 $6 $7 $8" 2>&1
     if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
 }
--- a/jdk/test/java/rmi/activation/Activatable/extLoadedImpl/ext.sh	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/rmi/activation/Activatable/extLoadedImpl/ext.sh	Wed Aug 10 15:51:25 2016 -0700
@@ -52,9 +52,9 @@
 $COMPILEJAVA/bin/jar ${TESTTOOLVMOPTS} cf ext/ext.jar -C $TESTCLASSES ExtLoadedImpl.class -C $TESTCLASSES ExtLoadedImpl_Stub.class -C $TESTCLASSES CheckLoader.class
 
 TESTVMOPTS="${TESTVMOPTS} \
- -XaddExports:java.rmi/sun.rmi.registry=ALL-UNNAMED \
- -XaddExports:java.rmi/sun.rmi.server=ALL-UNNAMED \
- -XaddExports:java.rmi/sun.rmi.transport=ALL-UNNAMED \
- -XaddExports:java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED"
+ --add-exports java.rmi/sun.rmi.registry=ALL-UNNAMED \
+ --add-exports java.rmi/sun.rmi.server=ALL-UNNAMED \
+ --add-exports java.rmi/sun.rmi.transport=ALL-UNNAMED \
+ --add-exports java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED"
 $TESTJAVA/bin/java ${TESTVMOPTS} -cp classes -Dtest.src=$TESTSRC -Dtest.classes=$TESTCLASSES -Djava.security.policy=$TESTSRC/security.policy -Djava.ext.dirs=ext ExtLoadedImplTest
 
--- a/jdk/test/java/rmi/activation/ActivationGroup/downloadActivationGroup/DownloadActivationGroup.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/rmi/activation/ActivationGroup/downloadActivationGroup/DownloadActivationGroup.java	Wed Aug 10 15:51:25 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,6 @@
 /*
  * @test
  * @bug 4510355
- * @key intermittent
  * @summary ActivationGroup implementations cannot be downloaded by default;
  * Creates a custom activation group without setting a security manager
  * in activation group's descriptor.  The custom activation group
@@ -140,10 +139,10 @@
             CommandEnvironment cmd = new ActivationGroupDesc.CommandEnvironment(
                     null,
                     new String[] {
-                        "-XaddExports:java.rmi/sun.rmi.registry=ALL-UNNAMED",
-                        "-XaddExports:java.rmi/sun.rmi.server=ALL-UNNAMED",
-                        "-XaddExports:java.rmi/sun.rmi.transport=ALL-UNNAMED",
-                        "-XaddExports:java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED" });
+                        "--add-exports=java.rmi/sun.rmi.registry=ALL-UNNAMED",
+                        "--add-exports=java.rmi/sun.rmi.server=ALL-UNNAMED",
+                        "--add-exports=java.rmi/sun.rmi.transport=ALL-UNNAMED",
+                        "--add-exports=java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED" });
 
             ActivationGroupDesc groupDesc =
                 new ActivationGroupDesc("MyActivationGroupImpl",
--- a/jdk/test/java/rmi/activation/ActivationSystem/stubClassesPermitted/StubClassesPermitted.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/rmi/activation/ActivationSystem/stubClassesPermitted/StubClassesPermitted.java	Wed Aug 10 15:51:25 2016 -0700
@@ -121,11 +121,11 @@
             System.err.println("Create activation group, in a new VM");
             CommandEnvironment cmd = new ActivationGroupDesc.CommandEnvironment(null,
                     new String[] {
-                        "-XaddExports:java.base/sun.security.provider=ALL-UNNAMED",
-                        "-XaddExports:java.rmi/sun.rmi.registry=ALL-UNNAMED",
-                        "-XaddExports:java.rmi/sun.rmi.server=ALL-UNNAMED",
-                        "-XaddExports:java.rmi/sun.rmi.transport=ALL-UNNAMED",
-                        "-XaddExports:java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED" });
+                        "--add-exports=java.base/sun.security.provider=ALL-UNNAMED",
+                        "--add-exports=java.rmi/sun.rmi.registry=ALL-UNNAMED",
+                        "--add-exports=java.rmi/sun.rmi.server=ALL-UNNAMED",
+                        "--add-exports=java.rmi/sun.rmi.transport=ALL-UNNAMED",
+                        "--add-exports=java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED" });
 
             ActivationGroupDesc groupDesc =
                 new ActivationGroupDesc(p, cmd);
--- a/jdk/test/java/rmi/activation/rmidViaInheritedChannel/InheritedChannelNotServerSocket.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/rmi/activation/rmidViaInheritedChannel/InheritedChannelNotServerSocket.java	Wed Aug 10 15:51:25 2016 -0700
@@ -106,7 +106,7 @@
             rmid = RMID.createRMID(System.out, System.err, true, true,
                                    TestLibrary.INHERITEDCHANNELNOTSERVERSOCKET_ACTIVATION_PORT);
             rmid.addOptions(
-                "-XaddExports:java.base/sun.nio.ch=ALL-UNNAMED",
+                "--add-exports=java.base/sun.nio.ch=ALL-UNNAMED",
                 "-Djava.nio.channels.spi.SelectorProvider=InheritedChannelNotServerSocket$SP");
             rmid.start();
 
--- a/jdk/test/java/rmi/activation/rmidViaInheritedChannel/RmidViaInheritedChannel.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/rmi/activation/rmidViaInheritedChannel/RmidViaInheritedChannel.java	Wed Aug 10 15:51:25 2016 -0700
@@ -93,7 +93,7 @@
             rmid = RMID.createRMID(System.out, System.err, true, false,
                                    TestLibrary.RMIDVIAINHERITEDCHANNEL_ACTIVATION_PORT);
             rmid.addOptions(
-                "-XaddExports:java.base/sun.nio.ch=ALL-UNNAMED",
+                "--add-exports=java.base/sun.nio.ch=ALL-UNNAMED",
                 "-Djava.nio.channels.spi.SelectorProvider=RmidViaInheritedChannel$RmidSelectorProvider");
             if (System.getProperty("os.name").startsWith("Windows") &&
                 System.getProperty("os.version").startsWith("5."))
--- a/jdk/test/java/rmi/module/ModuleTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/rmi/module/ModuleTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -97,8 +97,8 @@
      */
     @Test
     public void testAllInModule() throws Exception {
-        assertEquals(executeTestJava("-mp", pathJoin(MTEST_JAR, CLIENT_JAR, SERVER_JAR),
-                "-addmods", "mclient,mserver",
+        assertEquals(executeTestJava("--module-path", pathJoin(MTEST_JAR, CLIENT_JAR, SERVER_JAR),
+                "--add-modules", "mclient,mserver",
                 "-m", "mtest/" + DUMMY_MAIN)
                 .outputTo(System.out)
                 .errorTo(System.out)
@@ -113,7 +113,7 @@
      */
     @Test
     public void testAppInModule() throws Exception {
-        assertEquals(executeTestJava("-mp", MTEST_JAR,
+        assertEquals(executeTestJava("--module-path", MTEST_JAR,
                 "-cp", pathJoin(CLIENT_JAR, SERVER_JAR),
                 "-m", "mtest/" + DUMMY_MAIN)
                 .outputTo(System.out)
@@ -129,8 +129,8 @@
      */
     @Test
     public void testAppInUnnamedModule() throws Exception {
-        assertEquals(executeTestJava("-mp", pathJoin(CLIENT_JAR, SERVER_JAR),
-                "-addmods", "mclient,mserver",
+        assertEquals(executeTestJava("--module-path", pathJoin(CLIENT_JAR, SERVER_JAR),
+                "--add-modules", "mclient,mserver",
                 "-cp", MTEST_JAR,
                 DUMMY_MAIN)
                 .outputTo(System.out)
@@ -146,8 +146,8 @@
      */
     @Test
     public void testClientInUnamedModule() throws Exception {
-        assertEquals(executeTestJava("-mp", pathJoin(MTEST_JAR, SERVER_JAR),
-                "-addmods", "mserver",
+        assertEquals(executeTestJava("--module-path", pathJoin(MTEST_JAR, SERVER_JAR),
+                "--add-modules", "mserver",
                 "-cp", CLIENT_JAR,
                 "-m", "mtest/" + DUMMY_MAIN)
                 .outputTo(System.out)
--- a/jdk/test/java/rmi/registry/readTest/readTest.sh	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/rmi/registry/readTest/readTest.sh	Wed Aug 10 15:51:25 2016 -0700
@@ -99,10 +99,10 @@
 esac
 # trailing / after code base is important for rmi codebase property.
 TESTVMOPTS="${TESTVMOPTS} \
- -XaddExports:java.rmi/sun.rmi.registry=ALL-UNNAMED \
- -XaddExports:java.rmi/sun.rmi.server=ALL-UNNAMED \
- -XaddExports:java.rmi/sun.rmi.transport=ALL-UNNAMED \
- -XaddExports:java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED"
+ --add-exports java.rmi/sun.rmi.registry=ALL-UNNAMED \
+ --add-exports java.rmi/sun.rmi.server=ALL-UNNAMED \
+ --add-exports java.rmi/sun.rmi.transport=ALL-UNNAMED \
+ --add-exports java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED"
 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -cp $TEST_CLASSPATH ${ARGS} -Djava.rmi.server.codebase=${FILEURL}$CODEBASE/ readTest > OUT.TXT 2>&1 &
 TEST_PID=$!
 #bulk of testcase - let it run for a while
--- a/jdk/test/java/rmi/transport/checkFQDN/CheckFQDN.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/rmi/transport/checkFQDN/CheckFQDN.java	Wed Aug 10 15:51:25 2016 -0700
@@ -123,10 +123,10 @@
                                     propOption + property +
                                     equal +
                                     propertyValue + extraProp +
-                                    " -XaddExports:java.rmi/sun.rmi.registry=ALL-UNNAMED" +
-                                    " -XaddExports:java.rmi/sun.rmi.server=ALL-UNNAMED" +
-                                    " -XaddExports:java.rmi/sun.rmi.transport=ALL-UNNAMED" +
-                                    " -XaddExports:java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED" +
+                                    " --add-exports=java.rmi/sun.rmi.registry=ALL-UNNAMED" +
+                                    " --add-exports=java.rmi/sun.rmi.server=ALL-UNNAMED" +
+                                    " --add-exports=java.rmi/sun.rmi.transport=ALL-UNNAMED" +
+                                    " --add-exports=java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED" +
                                     " -Drmi.registry.port=" +
                                     REGISTRY_PORT,
                                     "");
--- a/jdk/test/java/rmi/transport/dgcDeadLock/DGCDeadLock.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/rmi/transport/dgcDeadLock/DGCDeadLock.java	Wed Aug 10 15:51:25 2016 -0700
@@ -75,10 +75,10 @@
         try {
             String options = " -Djava.security.policy=" +
                 TestParams.defaultPolicy +
-                " -XaddExports:java.rmi/sun.rmi.registry=ALL-UNNAMED" +
-                " -XaddExports:java.rmi/sun.rmi.server=ALL-UNNAMED" +
-                " -XaddExports:java.rmi/sun.rmi.transport=ALL-UNNAMED" +
-                " -XaddExports:java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED" +
+                " --add-exports java.rmi/sun.rmi.registry=ALL-UNNAMED" +
+                " --add-exports java.rmi/sun.rmi.server=ALL-UNNAMED" +
+                " --add-exports java.rmi/sun.rmi.transport=ALL-UNNAMED" +
+                " --add-exports java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED" +
                 " -Djava.rmi.dgc.leaseValue=500000" +
                 "  -Dsun.rmi.dgc.checkInterval=" +
                 (HOLD_TARGET_TIME - 5000) +
--- a/jdk/test/java/security/Provider/SecurityProviderModularTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/security/Provider/SecurityProviderModularTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -317,7 +317,7 @@
         vmArgs.put("-Duser.language=", "en");
         vmArgs.put("-Duser.region=", "US");
         if (addModName != null && sModuletype == MODULE_TYPE.AUTO) {
-            vmArgs.put("-addmods ", addModName);
+            vmArgs.put("--add-modules=", addModName);
         }
         // If mechanism selected to find the provider through
         // Security.getProvider() then use providerName/ProviderClassName based
--- a/jdk/test/java/security/modules/ModularTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/security/modules/ModularTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -137,7 +137,7 @@
         final StringJoiner command = new StringJoiner(SPACE, SPACE, SPACE);
         vmArgs.forEach((key, value) -> command.add(key + value));
         if (modulePath != null) {
-            command.add("-mp").add(modulePath.toFile().getCanonicalPath());
+            command.add("--module-path").add(modulePath.toFile().getCanonicalPath());
         }
         if (classPath != null && classPath.length() > 0) {
             command.add("-cp").add(classPath);
--- a/jdk/test/java/security/testlibrary/Proc.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/security/testlibrary/Proc.java	Wed Aug 10 15:51:25 2016 -0700
@@ -25,19 +25,19 @@
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStreamReader;
-import java.net.URL;
-import java.net.URLClassLoader;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.security.Permission;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Base64;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
+import java.util.stream.Stream;
 
 /**
  * This is a test library that makes writing a Java test that spawns multiple
@@ -184,12 +184,9 @@
                         "java").getPath());
         }
 
-        int n = 0;
-        String addexports;
-        while ((addexports = System.getProperty("jdk.launcher.addexports." + n)) != null) {
-            prop("jdk.launcher.addexports." + n, addexports);
-            n++;
-        }
+        Stream.of(jdk.internal.misc.VM.getRuntimeArguments())
+            .filter(arg -> arg.startsWith("--add-exports="))
+            .forEach(cmd::add);
 
         Collections.addAll(cmd, splitProperty("test.vm.opts"));
         Collections.addAll(cmd, splitProperty("test.java.opts"));
--- a/jdk/test/java/util/Calendar/GenericTimeZoneNamesTest.sh	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/util/Calendar/GenericTimeZoneNamesTest.sh	Wed Aug 10 15:51:25 2016 -0700
@@ -31,7 +31,7 @@
 # This test is locale data-dependent and assumes that both JRE and CLDR
 # have the same geneic time zone names in English.
 
-EXTRAOPTS="-XaddExports:java.base/sun.util.locale.provider=ALL-UNNAMED"
+EXTRAOPTS="--add-exports java.base/sun.util.locale.provider=ALL-UNNAMED"
 STATUS=0
 echo "Locale providers: default"
 if ! ${TESTJAVA}/bin/java -esa ${TESTVMOPTS} ${EXTRAOPTS} -cp "${TESTCLASSES}" GenericTimeZoneNamesTest en-US; then
--- a/jdk/test/java/util/Formatter/Basic.sh	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/util/Formatter/Basic.sh	Wed Aug 10 15:51:25 2016 -0700
@@ -23,7 +23,7 @@
 
 #
 
-EXTRAOPTS="-XaddExports:java.base/jdk.internal.math=ALL-UNNAMED"
+EXTRAOPTS="--add-exports java.base/jdk.internal.math=ALL-UNNAMED"
 ${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} ${EXTRAOPTS} -cp ${TESTSRC} -d . \
     ${TESTSRC}/Basic.java
 
--- a/jdk/test/java/util/Locale/LocaleProviders.sh	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/util/Locale/LocaleProviders.sh	Wed Aug 10 15:51:25 2016 -0700
@@ -122,8 +122,8 @@
 tznp8013086
 EOF
 
-EXTRAOPTS="-XaddExports:java.base/sun.util.locale=ALL-UNNAMED \
- -XaddExports:java.base/sun.util.locale.provider=ALL-UNNAMED"
+EXTRAOPTS="--add-exports java.base/sun.util.locale=ALL-UNNAMED \
+ --add-exports java.base/sun.util.locale.provider=ALL-UNNAMED"
 
 ${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d ${SPIDIR}${FS}dest \
     ${SPIDIR}${FS}src${FS}tznp.java \
--- a/jdk/test/java/util/PluggableLocale/ExecTest.sh	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/util/PluggableLocale/ExecTest.sh	Wed Aug 10 15:51:25 2016 -0700
@@ -93,8 +93,8 @@
 esac
 
 
-EXTRA_OPTS="-XaddExports:java.base/sun.util.locale.provider=ALL-UNNAMED \
- -XaddExports:java.base/sun.util.resources=ALL-UNNAMED"
+EXTRA_OPTS="--add-exports java.base/sun.util.locale.provider=ALL-UNNAMED \
+ --add-exports java.base/sun.util.resources=ALL-UNNAMED"
 
 # compile
 cp ${TESTSRC}${FS}ProviderTest.java .
--- a/jdk/test/java/util/ResourceBundle/Bug6299235Test.sh	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/util/ResourceBundle/Bug6299235Test.sh	Wed Aug 10 15:51:25 2016 -0700
@@ -68,7 +68,7 @@
 ${TESTJAVA}/bin/jar xf ${TESTSRC}/awtres.jar
 
 echo 
-${TESTJAVA}/bin/java ${TESTVMOPTS} -Xpatch:java.desktop=${PATCHDIR}/java.desktop \
+${TESTJAVA}/bin/java ${TESTVMOPTS} --patch-module java.desktop=${PATCHDIR}/java.desktop \
      -cp ${TESTCLASSES} Bug6299235Test
 
 if [ $? -ne 0 ]
--- a/jdk/test/java/util/ResourceBundle/modules/appbasic/appbasic.sh	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/util/ResourceBundle/modules/appbasic/appbasic.sh	Wed Aug 10 15:51:25 2016 -0700
@@ -47,7 +47,7 @@
   mkdir -p mods/$B
   CLASSES="`find $TESTSRC/src/$B -name '*.java'`"
   if [ "x$CLASSES" != x ]; then
-    $JAVAC -g -d mods -modulesourcepath $TESTSRC/src -cp mods/test $CLASSES
+    $JAVAC -g -d mods --module-source-path $TESTSRC/src -cp mods/test $CLASSES
   fi
   PROPS="`(cd $TESTSRC/src/$B; find . -name '*.properties')`"
   if [ "x$PROPS" != x ]; then
@@ -61,8 +61,8 @@
 done
 
 mkdir -p mods/test
-$JAVAC -g -d mods -modulesourcepath $TESTSRC/src `find $TESTSRC/src/test -name "*.java"`
+$JAVAC -g -d mods --module-source-path $TESTSRC/src `find $TESTSRC/src/test -name "*.java"`
 
-$JAVA -mp mods -m test/jdk.test.Main de fr ja zh-tw en de
+$JAVA -p mods -m test/jdk.test.Main de fr ja zh-tw en de
 
 exit $?
--- a/jdk/test/java/util/ResourceBundle/modules/appbasic2/appbasic2.sh	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/util/ResourceBundle/modules/appbasic2/appbasic2.sh	Wed Aug 10 15:51:25 2016 -0700
@@ -47,7 +47,7 @@
   mkdir -p mods/$B
   CLASSES="`find $TESTSRC/src/$B -name '*.java'`"
   if [ "x$CLASSES" != x ]; then
-    $JAVAC -g -d mods -modulesourcepath $TESTSRC/src -cp mods/test $CLASSES
+    $JAVAC -g -d mods --module-source-path $TESTSRC/src -cp mods/test $CLASSES
   fi
   PROPS="`(cd $TESTSRC/src/$B; find . -name '*.properties')`"
   if [ "x$PROPS" != x ]; then
@@ -61,8 +61,8 @@
 done
 
 mkdir -p mods/test
-$JAVAC -g -d mods -modulesourcepath $TESTSRC/src `find $TESTSRC/src/test -name "*.java"`
+$JAVAC -g -d mods --module-source-path $TESTSRC/src `find $TESTSRC/src/test -name "*.java"`
 
-$JAVA -mp mods -m test/jdk.test.Main de fr ja zh-tw en de
+$JAVA -p mods -m test/jdk.test.Main de fr ja zh-tw en de
 
 exit $?
--- a/jdk/test/java/util/ResourceBundle/modules/basic/basic.sh	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/util/ResourceBundle/modules/basic/basic.sh	Wed Aug 10 15:51:25 2016 -0700
@@ -52,7 +52,7 @@
   mkdir -p mods/$B
   CLASSES="`find $TESTSRC/src/$B -name '*.java'`"
   if [ "x$CLASSES" != x ]; then
-    $JAVAC -g -d mods -modulesourcepath $TESTSRC/src $CP $CLASSES
+    $JAVAC -g -d mods --module-source-path $TESTSRC/src $CP $CLASSES
   fi
   PROPS="`(cd $TESTSRC/src/$B; find . -name '*.properties')`"
   if [ "x$PROPS" != x ]; then
@@ -67,7 +67,7 @@
 done
 
 mkdir -p mods/test
-$JAVAC -g -cp mods/mainbundles -d mods -modulesourcepath $TESTSRC/src \
+$JAVAC -g -cp mods/mainbundles -d mods --module-source-path $TESTSRC/src \
     `find $TESTSRC/src/test -name "*.java"`
 
 # Create a jar to be added to the class path. Expected only properties files are
@@ -81,9 +81,9 @@
 STATUS=0
 
 echo "jdk.test.Main should load bundles using ResourceBundleProviders."
-$JAVA -mp mods -m test/jdk.test.Main de fr ja ja-jp zh-tw en de ja-jp || STATUS=1
+$JAVA -p mods -m test/jdk.test.Main de fr ja ja-jp zh-tw en de ja-jp || STATUS=1
 
 echo "jdk.test.Main should NOT load bundles from the jar file specified by the class-path."
-$JAVA -cp extra.jar -mp mods -m test/jdk.test.Main es vi && STATUS=1
+$JAVA -cp extra.jar -p mods -m test/jdk.test.Main es vi && STATUS=1
 
 exit $STATUS
--- a/jdk/test/java/util/ResourceBundle/modules/modlocal/modlocal.sh	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/util/ResourceBundle/modules/modlocal/modlocal.sh	Wed Aug 10 15:51:25 2016 -0700
@@ -57,7 +57,7 @@
     done
 fi
 
-$JAVAC -g -d mods -modulesourcepath $TESTSRC/src \
+$JAVAC -g -d mods --module-source-path $TESTSRC/src \
        -cp mods/bundles `find $TESTSRC/src/test -name "*.java"`
 
 # Create a jar to be added to the class path. Expected properties files are
@@ -69,9 +69,9 @@
 STATUS=0
 
 echo 'jdk.test.Main should load bundles local to named module "test".'
-$JAVA -mp mods -m test/jdk.test.Main de fr ja zh-tw en de || STATUS=1
+$JAVA -p mods -m test/jdk.test.Main de fr ja zh-tw en de || STATUS=1
 
 echo "jdk.test.Main should NOT load bundles from the jar file specified by the class-path."
-$JAVA -cp extra.jar -mp mods -m test/jdk.test.Main vi && STATUS=1
+$JAVA -cp extra.jar -p mods -m test/jdk.test.Main vi && STATUS=1
 
 exit $STATUS
--- a/jdk/test/java/util/ResourceBundle/modules/security/TestPermission.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/util/ResourceBundle/modules/security/TestPermission.java	Wed Aug 10 15:51:25 2016 -0700
@@ -59,7 +59,7 @@
     public void compileAll() throws Exception {
         for (String mn : modules) {
             Path msrc = SRC_DIR.resolve(mn);
-            assertTrue(CompilerUtils.compile(msrc, MODS_DIR, "-modulesourcepath", SRC_DIR.toString()));
+            assertTrue(CompilerUtils.compile(msrc, MODS_DIR, "--module-source-path", SRC_DIR.toString()));
         }
     }
 
@@ -68,7 +68,7 @@
      */
     @Test
     public void runTest() throws Exception {
-        int exitValue = executeTestJava("-mp", MODS_DIR.toString(),
+        int exitValue = executeTestJava("--module-path", MODS_DIR.toString(),
                                         "-m", "test/jdk.test.Main")
                             .outputTo(System.out)
                             .errorTo(System.out)
--- a/jdk/test/java/util/ResourceBundle/modules/simple/simple.sh	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/util/ResourceBundle/modules/simple/simple.sh	Wed Aug 10 15:51:25 2016 -0700
@@ -50,7 +50,7 @@
 mkdir -p mods/$B
 CLASSES="`find $TESTSRC/src/$B -name '*.java'`"
 if [ "x$CLASSES" != x ]; then
-    $JAVAC -g -d mods -modulesourcepath $TESTSRC/src $CLASSES
+    $JAVAC -g -d mods --module-source-path $TESTSRC/src $CLASSES
 fi
 PROPS="`(cd $TESTSRC/src/$B; find . -name '*.properties')`"
 if [ "x$PROPS" != x ]; then
@@ -62,9 +62,9 @@
     done
 fi
 
-$JAVAC -g -d mods -modulesourcepath $TESTSRC/src \
+$JAVAC -g -d mods --module-source-path $TESTSRC/src \
        -cp mods/bundles `find $TESTSRC/src/test -name "*.java"`
 
-$JAVA -mp mods -m test/jdk.test.Main de fr ja zh-tw en de
+$JAVA -p mods -m test/jdk.test.Main de fr ja zh-tw en de
 
 exit $?
--- a/jdk/test/java/util/ResourceBundle/modules/visibility/visibility.sh	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/util/ResourceBundle/modules/visibility/visibility.sh	Wed Aug 10 15:51:25 2016 -0700
@@ -57,7 +57,7 @@
     mkdir -p mods/$M
     CLASSES="`find $TESTSRC/src/$M -name '*.java'`"
     if [ "x$CLASSES" != x ]; then
-        $JAVAC -g -d mods -modulesourcepath $TESTSRC/src $CLASSES
+        $JAVAC -g -d mods --module-source-path $TESTSRC/src $CLASSES
     fi
     PROPS="`(cd $TESTSRC/src/$M; find . -name '*.properties')`"
     if [ "x$PROPS" != x ]; then
@@ -96,23 +96,23 @@
 
 # jdk.test.resources.{classes,props}.* are available only to named module "test"
 # by ResourceBundleProvider.
-runJava -mp mods -m test/jdk.test.TestWithNoModuleArg \
+runJava -p mods -m test/jdk.test.TestWithNoModuleArg \
     jdk.test.resources.classes.MyResources true
-runJava -mp mods -m test/jdk.test.TestWithNoModuleArg \
+runJava -p mods -m test/jdk.test.TestWithNoModuleArg \
     jdk.test.resources.props.MyResources true
-runJava -mp mods -m embargo/jdk.embargo.TestWithNoModuleArg \
+runJava -p mods -m embargo/jdk.embargo.TestWithNoModuleArg \
     jdk.test.resources.classes.MyResources false
-runJava -mp mods -m embargo/jdk.embargo.TestWithNoModuleArg \
+runJava -p mods -m embargo/jdk.embargo.TestWithNoModuleArg \
     jdk.test.resources.props.MyResources false
 
 # Add mods/named.bundles to the class path.
-runJava -cp mods/named.bundles -mp mods -m test/jdk.test.TestWithNoModuleArg \
+runJava -cp mods/named.bundles -p mods -m test/jdk.test.TestWithNoModuleArg \
     jdk.test.resources.classes.MyResources true
-runJava -cp mods/named.bundles -mp mods -m test/jdk.test.TestWithNoModuleArg \
+runJava -cp mods/named.bundles -p mods -m test/jdk.test.TestWithNoModuleArg \
     jdk.test.resources.props.MyResources true
-runJava -cp mods/named.bundles -mp mods -m embargo/jdk.embargo.TestWithNoModuleArg \
+runJava -cp mods/named.bundles -p mods -m embargo/jdk.embargo.TestWithNoModuleArg \
     jdk.test.resources.classes.MyResources false
-runJava -cp mods/named.bundles -mp mods -m embargo/jdk.embargo.TestWithNoModuleArg \
+runJava -cp mods/named.bundles -p mods -m embargo/jdk.embargo.TestWithNoModuleArg \
     jdk.test.resources.props.MyResources false
 
 # Tests using jdk.test.TestWithUnnamedModuleArg and jdk.embargo.TestWithUnnamedModuleArg
@@ -120,37 +120,37 @@
 
 # jdk.test.resources.classes is exported to named module "test".
 # IllegalAccessException is thrown in ResourceBundle.Control.newBundle().
-runJava -mp mods -m test/jdk.test.TestWithUnnamedModuleArg \
+runJava -p mods -m test/jdk.test.TestWithUnnamedModuleArg \
     jdk.test.resources.classes.MyResources false
 
 # jdk.test.resources.props is exported to named module "test".
 # loader.getResource() doesn't find jdk.test.resources.props.MyResources.
-runJava -mp mods -m test/jdk.test.TestWithUnnamedModuleArg \
+runJava -p mods -m test/jdk.test.TestWithUnnamedModuleArg \
     jdk.test.resources.props.MyResources false
 
 # IllegalAccessException is thrown in ResourceBundle.Control.newBundle().
-runJava -mp mods -m embargo/jdk.embargo.TestWithUnnamedModuleArg \
+runJava -p mods -m embargo/jdk.embargo.TestWithUnnamedModuleArg \
     jdk.test.resources.classes.MyResources false
 # jdk.test.resources.props is exported to named module "test".
 # loader.getResource() doesn't find jdk.test.resources.props.MyResources.
-runJava -mp mods -m embargo/jdk.embargo.TestWithUnnamedModuleArg \
+runJava -p mods -m embargo/jdk.embargo.TestWithUnnamedModuleArg \
     jdk.test.resources.props.MyResources false
 
 # Add mods/named.bundles to the class path
 
 # IllegalAccessException is thrown in ResourceBundle.Control.newBundle().
-runJava -cp mods/named.bundles -mp mods -m test/jdk.test.TestWithUnnamedModuleArg \
+runJava -cp mods/named.bundles -p mods -m test/jdk.test.TestWithUnnamedModuleArg \
         jdk.test.resources.classes.MyResources false
 # loader.getResource() finds jdk.test.resources.exported.props.MyResources.
-runJava -cp mods/named.bundles -mp mods -m test/jdk.test.TestWithUnnamedModuleArg \
+runJava -cp mods/named.bundles -p mods -m test/jdk.test.TestWithUnnamedModuleArg \
         jdk.test.resources.props.MyResources true
 
 # jdk.test.resources.exported.classes.MyResources is treated
 # as if the class is in an unnamed module.
-runJava -cp mods/named.bundles -mp mods -m embargo/jdk.embargo.TestWithUnnamedModuleArg \
+runJava -cp mods/named.bundles -p mods -m embargo/jdk.embargo.TestWithUnnamedModuleArg \
         jdk.test.resources.classes.MyResources true
 # loader.getResource() finds jdk.test.resources.exported.props.MyResources.
-runJava -cp mods/named.bundles -mp mods -m embargo/jdk.embargo.TestWithUnnamedModuleArg \
+runJava -cp mods/named.bundles -p mods -m embargo/jdk.embargo.TestWithUnnamedModuleArg \
         jdk.test.resources.props.MyResources true
 
 #################################################
@@ -160,23 +160,23 @@
 # neither of which specifies an unnamed module with ResourceBundle.getBundle.
 
 # None of jdk.test.resources.exported.** is available to the named modules.
-runJava -mp mods -m test/jdk.test.TestWithNoModuleArg \
+runJava -p mods -m test/jdk.test.TestWithNoModuleArg \
     jdk.test.resources.exported.classes.MyResources false
-runJava -mp mods -m test/jdk.test.TestWithNoModuleArg \
+runJava -p mods -m test/jdk.test.TestWithNoModuleArg \
     jdk.test.resources.exported.props.MyResources false
-runJava -mp mods -m embargo/jdk.embargo.TestWithNoModuleArg \
+runJava -p mods -m embargo/jdk.embargo.TestWithNoModuleArg \
     jdk.test.resources.exported.classes.MyResources false
-runJava -mp mods -m embargo/jdk.embargo.TestWithNoModuleArg \
+runJava -p mods -m embargo/jdk.embargo.TestWithNoModuleArg \
     jdk.test.resources.exported.props.MyResources false
 
 # Add mods/exported.named.bundles to the class path.
-runJava -cp mods/exported.named.bundles -mp mods -m test/jdk.test.TestWithNoModuleArg \
+runJava -cp mods/exported.named.bundles -p mods -m test/jdk.test.TestWithNoModuleArg \
     jdk.test.resources.exported.classes.MyResources false
-runJava -cp mods/exported.named.bundles -mp mods -m test/jdk.test.TestWithNoModuleArg \
+runJava -cp mods/exported.named.bundles -p mods -m test/jdk.test.TestWithNoModuleArg \
     jdk.test.resources.exported.props.MyResources false
-runJava -cp mods/exported.named.bundles -mp mods -m embargo/jdk.embargo.TestWithNoModuleArg \
+runJava -cp mods/exported.named.bundles -p mods -m embargo/jdk.embargo.TestWithNoModuleArg \
     jdk.test.resources.exported.classes.MyResources false
-runJava -cp mods/exported.named.bundles -mp mods -m embargo/jdk.embargo.TestWithNoModuleArg \
+runJava -cp mods/exported.named.bundles -p mods -m embargo/jdk.embargo.TestWithNoModuleArg \
     jdk.test.resources.exported.props.MyResources false
 
 # Tests using jdk.test.TestWithUnnamedModuleArg and jdk.embargo.TestWithUnnamedModuleArg
@@ -184,36 +184,36 @@
 
 # loader.loadClass() doesn't find jdk.test.resources.exported.classes.MyResources
 # and throws a ClassNotFoundException.
-runJava -mp mods -m test/jdk.test.TestWithUnnamedModuleArg \
+runJava -p mods -m test/jdk.test.TestWithUnnamedModuleArg \
         jdk.test.resources.exported.classes.MyResources false
 # The properties files in jdk.test.resources.exported.props are not found with loader.getResource().
-runJava -mp mods -m test/jdk.test.TestWithUnnamedModuleArg \
+runJava -p mods -m test/jdk.test.TestWithUnnamedModuleArg \
         jdk.test.resources.exported.props.MyResources false
 
 
 # loader.loadClass() doesn't find jdk.test.resources.exported.classes.MyResources
 # and throws a ClassNotFoundException.
-runJava -mp mods -m embargo/jdk.embargo.TestWithUnnamedModuleArg \
+runJava -p mods -m embargo/jdk.embargo.TestWithUnnamedModuleArg \
         jdk.test.resources.exported.classes.MyResources false
 # The properties files in jdk.test.resources.exported.props are not found
 # with loader.getResource().
-runJava -mp mods -m embargo/jdk.embargo.TestWithUnnamedModuleArg \
+runJava -p mods -m embargo/jdk.embargo.TestWithUnnamedModuleArg \
         jdk.test.resources.exported.props.MyResources false
 
 # Add mods/exported.named.bundles to the class path.
 
 # jdk.test.resources.exported.classes.MyResources.getModule().isNamed() returns false.
-runJava -cp mods/exported.named.bundles -mp mods -m test/jdk.test.TestWithUnnamedModuleArg \
+runJava -cp mods/exported.named.bundles -p mods -m test/jdk.test.TestWithUnnamedModuleArg \
         jdk.test.resources.exported.classes.MyResources true
 # loader.getResource() finds jdk.test.resources.exported.props.MyResources.
-runJava -cp mods/exported.named.bundles -mp mods -m test/jdk.test.TestWithUnnamedModuleArg \
+runJava -cp mods/exported.named.bundles -p mods -m test/jdk.test.TestWithUnnamedModuleArg \
         jdk.test.resources.exported.props.MyResources true
 
 # jdk.test.resources.exported.classes.MyResources.getModule().isNamed() returns false.
-runJava -cp mods/exported.named.bundles -mp mods -m embargo/jdk.embargo.TestWithUnnamedModuleArg \
+runJava -cp mods/exported.named.bundles -p mods -m embargo/jdk.embargo.TestWithUnnamedModuleArg \
         jdk.test.resources.exported.classes.MyResources true
 # loader.getResource() finds jdk.test.resources.exported.props.MyResources.
-runJava -cp mods/exported.named.bundles -mp mods -m embargo/jdk.embargo.TestWithUnnamedModuleArg \
+runJava -cp mods/exported.named.bundles -p mods -m embargo/jdk.embargo.TestWithUnnamedModuleArg \
         jdk.test.resources.exported.props.MyResources true
 
 #######################################
--- a/jdk/test/java/util/ResourceBundle/modules/xmlformat/xmlformat.sh	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/util/ResourceBundle/modules/xmlformat/xmlformat.sh	Wed Aug 10 15:51:25 2016 -0700
@@ -48,7 +48,7 @@
 mkdir -p mods/$B
 CLASSES="`find $TESTSRC/src/$B -name '*.java'`"
 if [ "x$CLASSES" != x ]; then
-    $JAVAC -g -d mods -modulesourcepath $TESTSRC/src $CLASSES
+    $JAVAC -g -d mods --module-source-path $TESTSRC/src $CLASSES
 fi
 PROPS="`(cd $TESTSRC/src/$B; find . -name '*.xml')`"
 if [ "x$PROPS" != x ]; then
@@ -60,9 +60,9 @@
     done
 fi
 
-$JAVAC -g -d mods -modulesourcepath $TESTSRC/src \
+$JAVAC -g -d mods --module-source-path $TESTSRC/src \
        -cp mods/bundles `find $TESTSRC/src/test -name "*.java"`
 
-$JAVA -mp mods -m test/jdk.test.Main de fr ja zh-tw en de
+$JAVA -p mods -m test/jdk.test.Main de fr ja zh-tw en de
 
 exit $?
--- a/jdk/test/java/util/ServiceLoader/modules/ServicesTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/util/ServiceLoader/modules/ServicesTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -105,13 +105,13 @@
 
 
     /**
-     * Run test with -modulepath.
+     * Run test with --module-path.
      *
      * BananaScriptEngine should be found.
      */
     public void runWithModulePath() throws Exception {
         int exitValue
-            = executeTestJava("-mp", MODS_DIR.toString(),
+            = executeTestJava("--module-path", MODS_DIR.toString(),
                               "-m", "test/test.Main",
                               "BananaScriptEngine")
                 .outputTo(System.out)
@@ -123,13 +123,13 @@
 
 
     /**
-     * Run test with -modulepath and -classpath.
+     * Run test with --module-path and -classpath.
      *
      * Both BananaScriptEngine and PearScriptEngine should be found
      */
     public void runWithModulePathAndClassPath() throws Exception {
         int exitValue
-            = executeTestJava("-mp", MODS_DIR.toString(),
+            = executeTestJava("--module-path", MODS_DIR.toString(),
                               "-cp", CLASSES_DIR.toString(),
                               "-m", "test/test.Main",
                               "BananaScriptEngine", "PearScriptEngine")
--- a/jdk/test/java/util/logging/modules/GetResourceBundleTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/java/util/logging/modules/GetResourceBundleTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -66,10 +66,10 @@
         for (String mn : modules) {
             Path msrc = MOD_SRC_DIR.resolve(mn);
             assertTrue(CompilerUtils.compile(msrc, MOD_DEST_DIR,
-                    "-modulesourcepath", MOD_SRC_DIR.toString()));
+                    "--module-source-path", MOD_SRC_DIR.toString()));
         }
         assertTrue(CompilerUtils.compile(PKG_SRC_DIR, PKG_DEST_DIR,
-                "-modulepath", MOD_DEST_DIR.toString(), "-addmods", String.join(",", modules)));
+                "--module-path", MOD_DEST_DIR.toString(), "--add-modules", String.join(",", modules)));
 
         // copy resource files
         String[] files = { "m1/p1/resource/p.properties", "m2/p2/resource/p.properties" };
@@ -84,8 +84,8 @@
     public void runWithoutSecurityManager() throws Exception {
         int exitValue = executeTestJava(
                 "-cp", PKG_DEST_DIR.toString(),
-                "-mp", MOD_DEST_DIR.toString(),
-                "-addmods", String.join(",", modules),
+                "--module-path", MOD_DEST_DIR.toString(),
+                "--add-modules", String.join(",", modules),
                 "p3.test.ResourceBundleTest")
                 .outputTo(System.out)
                 .errorTo(System.err)
@@ -98,8 +98,8 @@
         int exitValue = executeTestJava(
                 "-Djava.security.manager",
                 "-cp", PKG_DEST_DIR.toString(),
-                "-mp", MOD_DEST_DIR.toString(),
-                "-addmods", String.join(",", modules),
+                "--module-path", MOD_DEST_DIR.toString(),
+                "--add-modules", String.join(",", modules),
                 "p3.test.ResourceBundleTest")
                 .outputTo(System.out)
                 .errorTo(System.err)
--- a/jdk/test/javax/crypto/Cipher/CipherStreamClose.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/javax/crypto/Cipher/CipherStreamClose.java	Wed Aug 10 15:51:25 2016 -0700
@@ -27,8 +27,8 @@
  * @summary Make sure Cipher IO streams doesn't call extra doFinal if close()
  * is called multiple times.  Additionally, verify the input and output streams
  * match with encryption and decryption with non-stream crypto.
- * @compile -addmods java.xml.bind CipherStreamClose.java
- * @run main/othervm -addmods java.xml.bind CipherStreamClose
+ * @modules java.xml.bind
+ * @run main CipherStreamClose
  */
 
 import java.io.*;
--- a/jdk/test/javax/imageio/plugins/external_plugin_tests/TestClassPathPlugin.sh	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/javax/imageio/plugins/external_plugin_tests/TestClassPathPlugin.sh	Wed Aug 10 15:51:25 2016 -0700
@@ -86,7 +86,7 @@
 
 # expect to find SimpReader on module path
 echo "Test modular jar .. "
-$JAVA -mp $PLUGINDIR -cp $TESTDIR simptest.TestSIMPPlugin
+$JAVA --module-path $PLUGINDIR -cp $TESTDIR simptest.TestSIMPPlugin
 
 if [ $? -ne 0 ]; then
     exception=1
@@ -94,7 +94,7 @@
 fi
 
 echo "Test modular jar with security manager .."
-$JAVA -Djava.security.manager -mp $PLUGINDIR -cp $TESTDIR simptest.TestSIMPPlugin
+$JAVA -Djava.security.manager --module-path $PLUGINDIR -cp $TESTDIR simptest.TestSIMPPlugin
 if [ $? -ne 0 ]; then
     exception=1
     echo "modular jar with security manager test failed: exception thrown!"
--- a/jdk/test/javax/imageio/stream/StreamCloserLeak/run_test.sh	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/javax/imageio/stream/StreamCloserLeak/run_test.sh	Wed Aug 10 15:51:25 2016 -0700
@@ -199,14 +199,14 @@
 fi
 
 # Verify that all classloaders are destroyed
-${TESTJAVA}/bin/java -XaddExports:java.desktop/sun.awt=ALL-UNNAMED ${TESTVMOPTS} -cp Test.jar test.Main
+${TESTJAVA}/bin/java --add-exports java.desktop/sun.awt=ALL-UNNAMED ${TESTVMOPTS} -cp Test.jar test.Main
 if [ $? -ne 0 ] ; then
     fail "Test FAILED: some classloaders weren't destroyed."
 fi
 
 
 # Verify that ImageIO shutdown hook works correcly
-${TESTJAVA}/bin/java -XaddExports:java.desktop/sun.awt=ALL-UNNAMED ${TESTVMOPTS} \
+${TESTJAVA}/bin/java --add-exports java.desktop/sun.awt=ALL-UNNAMED ${TESTVMOPTS} \
     -cp Test.jar -DforgetSomeStreams=true test.Main
 if [ $? -ne 0 ] ; then
     fail "Test FAILED: some classloaders weren't destroyed of shutdown hook failed."
--- a/jdk/test/javax/naming/module/basic.sh	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/javax/naming/module/basic.sh	Wed Aug 10 15:51:25 2016 -0700
@@ -78,27 +78,27 @@
 
 echo "\nPreparing the 'test' module..."
 mkdir -p mods/test
-$JAVAC -d mods -modulesourcepath $TESTSRC/src `find $TESTSRC/src/test -name "*.java"`
+$JAVAC -d mods --module-source-path $TESTSRC/src `find $TESTSRC/src/test -name "*.java"`
 
 
 echo "\nRunning with the 'java.desktop' module..."
-$JAVA -Dtest.src=${TESTSRC} -mp mods -m test/test.StoreObject ldap://localhost/dc=ie,dc=oracle,dc=com
+$JAVA -Dtest.src=${TESTSRC} -p mods -m test/test.StoreObject ldap://localhost/dc=ie,dc=oracle,dc=com
 
 echo "\nRunning with the 'person' module..."
-$JAVA -Dtest.src=${TESTSRC} -mp mods -m test/test.StorePerson ldap://localhost/dc=ie,dc=oracle,dc=com
+$JAVA -Dtest.src=${TESTSRC} -p mods -m test/test.StorePerson ldap://localhost/dc=ie,dc=oracle,dc=com
 
 echo "\nRunning with the 'fruit' module..."
-$JAVA -Dtest.src=${TESTSRC} -mp mods -m test/test.StoreFruit ldap://localhost/dc=ie,dc=oracle,dc=com
+$JAVA -Dtest.src=${TESTSRC} -p mods -m test/test.StoreFruit ldap://localhost/dc=ie,dc=oracle,dc=com
 
 echo "\nRunning with the 'hello' module..."
-$JAVA -Dtest.src=${TESTSRC} -mp mods -m test/test.StoreRemote ldap://localhost/dc=ie,dc=oracle,dc=com
+$JAVA -Dtest.src=${TESTSRC} -p mods -m test/test.StoreRemote ldap://localhost/dc=ie,dc=oracle,dc=com
 
 echo "\nRunning with the 'foo' module..."
-$JAVA -Dtest.src=${TESTSRC} -mp mods -m test/test.ConnectWithFoo ldap://localhost/dc=ie,dc=oracle,dc=com
+$JAVA -Dtest.src=${TESTSRC} -p mods -m test/test.ConnectWithFoo ldap://localhost/dc=ie,dc=oracle,dc=com
 
 echo "\nRunning with the 'authz' module..."
-$JAVA -Dtest.src=${TESTSRC} -mp mods -m test/test.ConnectWithAuthzId ldap://localhost/dc=ie,dc=oracle,dc=com
+$JAVA -Dtest.src=${TESTSRC} -p mods -m test/test.ConnectWithAuthzId ldap://localhost/dc=ie,dc=oracle,dc=com
 
 echo "\nRunning with the 'ldapv4' module..."
-$JAVA -Dtest.src=${TESTSRC} -mp mods -m test/test.ReadByUrl ldap://localhost/dc=ie,dc=oracle,dc=com
+$JAVA -Dtest.src=${TESTSRC} -p mods -m test/test.ReadByUrl ldap://localhost/dc=ie,dc=oracle,dc=com
 
--- a/jdk/test/javax/rmi/PortableRemoteObject/8146975/RmiIiopReturnValueTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/javax/rmi/PortableRemoteObject/8146975/RmiIiopReturnValueTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -25,18 +25,19 @@
  * @test
  * @bug 8146975
  * @summary test RMI-IIOP with value object return
+ * @modules java.corba
  * @library /lib/testlibrary
  * @build jdk.testlibrary.*
- * @compile -addmods java.corba Test.java Test3.java Test4.java
+ * @compile Test.java Test3.java Test4.java
  *    HelloInterface.java HelloServer.java
  *    HelloClient.java HelloImpl.java _HelloImpl_Tie.java _HelloInterface_Stub.java
  *    RmiIiopReturnValueTest.java
- * @run main/othervm -addmods java.corba
+ * @run main/othervm
  *    -Djava.naming.provider.url=iiop://localhost:5050
  *    -Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory
  *    RmiIiopReturnValueTest -port 5049
  * @run main/othervm/secure=java.lang.SecurityManager/policy=jtreg.test.policy
- *    -addmods java.corba -Djava.naming.provider.url=iiop://localhost:5050
+ *    -Djava.naming.provider.url=iiop://localhost:5050
  *    -Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory
  *    RmiIiopReturnValueTest -port 5049
  */
@@ -102,12 +103,12 @@
 
     static void startRmiIiopServer() throws Exception {
         System.out.println("\nStarting RmiIiopServer");
-        // java -addmods java.corba -cp .
+        // java --add-modules java.corba -cp .
         // -Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory
         // -Djava.naming.provider.url=iiop://localhost:5050 HelloServer -port 5049
         List<String> commands = new ArrayList<>();
         commands.add(RmiIiopReturnValueTest.JAVA);
-        commands.add("-addmods");
+        commands.add("--add-modules");
         commands.add("java.corba");
         commands.add("-Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory");
         commands.add("-Djava.naming.provider.url=iiop://localhost:5050");
--- a/jdk/test/javax/rmi/PortableRemoteObject/ConcurrentHashMapTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/javax/rmi/PortableRemoteObject/ConcurrentHashMapTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -28,12 +28,12 @@
  * @library /lib/testlibrary
  * @modules java.corba
  * @build jdk.testlibrary.*
- * @compile -addmods java.corba Test.java HelloInterface.java HelloServer.java HelloClient.java
+ * @compile Test.java HelloInterface.java HelloServer.java HelloClient.java
  *    HelloImpl.java _HelloImpl_Tie.java _HelloInterface_Stub.java ConcurrentHashMapTest.java
- * @run main/othervm -addmods java.corba -Djava.naming.provider.url=iiop://localhost:1050
+ * @run main/othervm -Djava.naming.provider.url=iiop://localhost:1050
  *    -Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory ConcurrentHashMapTest
  * @run main/othervm/secure=java.lang.SecurityManager/policy=jtreg.test.policy
- *    -addmods java.corba -Djava.naming.provider.url=iiop://localhost:1050
+ *    -Djava.naming.provider.url=iiop://localhost:1050
  *    -Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory ConcurrentHashMapTest
  * @key intermittent
  */
@@ -98,12 +98,12 @@
 
     static void startRmiIiopServer() throws Exception {
         System.out.println("\nStarting RmiServer");
-        // java -cp . -addmods java.corba
+        // java -cp . --add-modules java.corba
         // -Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory
         // -Djava.naming.provider.url=iiop://localhost:1050 HelloServer
         List<String> commands = new ArrayList<>();
         commands.add(ConcurrentHashMapTest.JAVA);
-        commands.add("-addmods");
+        commands.add("--add-modules");
         commands.add("java.corba");
         commands.add("-Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory");
         commands.add("-Djava.naming.provider.url=iiop://localhost:1050");
--- a/jdk/test/javax/security/auth/login/modules/JaasModularClientTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/javax/security/auth/login/modules/JaasModularClientTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -291,7 +291,7 @@
         vmArgs.put("-Djava.security.auth.login.config=", SRC.resolve(
                 "jaas.conf").toFile().getCanonicalPath());
         if (addModName != null && sModuletype == MODULE_TYPE.AUTO) {
-            vmArgs.put("-addmods ", addModName);
+            vmArgs.put("--add-modules ", addModName);
         }
         return vmArgs;
     }
--- a/jdk/test/javax/security/auth/login/modules/JaasModularDefaultHandlerTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/javax/security/auth/login/modules/JaasModularDefaultHandlerTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -247,7 +247,7 @@
         if (addModName != null
                 && !(cModuleType == MODULE_TYPE.EXPLICIT
                 && sModuletype == MODULE_TYPE.EXPLICIT)) {
-            vmArgs.put("-addmods ", addModName);
+            vmArgs.put("--add-modules=", addModName);
         }
         return vmArgs;
     }
--- a/jdk/test/javax/smartcardio/CommandAPDUTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/javax/smartcardio/CommandAPDUTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -26,8 +26,8 @@
  * @bug 8049021
  * @summary Test different constructors for CommandAPDU and check CLA,INS,NC,NE,
  * P1,and P2
- * @compile -addmods java.smartcardio CommandAPDUTest.java
- * @run testng/othervm -addmods java.smartcardio CommandAPDUTest
+ * @compile --add-modules=java.smartcardio CommandAPDUTest.java
+ * @run testng/othervm --add-modules=java.smartcardio CommandAPDUTest
  */
 import java.nio.ByteBuffer;
 import javax.smartcardio.CommandAPDU;
--- a/jdk/test/javax/smartcardio/HistoricalBytes.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/javax/smartcardio/HistoricalBytes.java	Wed Aug 10 15:51:25 2016 -0700
@@ -26,8 +26,8 @@
  * @bug 6445367
  * @summary Verify that ATR.getHistoricalBytes() works
  * @author Andreas Sterbenz
- * @compile -addmods java.smartcardio HistoricalBytes.java
- * @run main/othervm -addmods java.smartcardio HistoricalBytes
+ * @compile --add-modules=java.smartcardio HistoricalBytes.java
+ * @run main/othervm --add-modules=java.smartcardio HistoricalBytes
  */
 
 import java.util.Arrays;
--- a/jdk/test/javax/smartcardio/ResponseAPDUTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/javax/smartcardio/ResponseAPDUTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -25,8 +25,8 @@
  * @test
  * @bug 8049021
  * @summary Construct ResponseAPDU from byte array and check NR< SW, SW1 and SW2
- * @compile -addmods java.smartcardio ResponseAPDUTest.java
- * @run testng/othervm -addmods java.smartcardio ResponseAPDUTest
+ * @compile --add-modules=java.smartcardio ResponseAPDUTest.java
+ * @run testng/othervm --add-modules=java.smartcardio ResponseAPDUTest
  */
 import javax.smartcardio.ResponseAPDU;
 import static org.testng.Assert.*;
--- a/jdk/test/javax/smartcardio/Serialize.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/javax/smartcardio/Serialize.java	Wed Aug 10 15:51:25 2016 -0700
@@ -26,8 +26,8 @@
  * @bug 6445367
  * @summary make sure serialization works
  * @author Andreas Sterbenz
- * @compile -addmods java.smartcardio Serialize.java
- * @run main/othervm -addmods java.smartcardio Serialize
+ * @compile --add-modules=java.smartcardio Serialize.java
+ * @run main/othervm --add-modules=java.smartcardio Serialize
  */
 
 import java.io.*;
--- a/jdk/test/javax/smartcardio/TerminalFactorySpiTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/javax/smartcardio/TerminalFactorySpiTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -25,8 +25,8 @@
  * @test
  * @bug 8049021
  * @summary Test if we can write new provider for smart card
- * @compile -addmods java.smartcardio TerminalFactorySpiTest.java
- * @run main/othervm/java.security.policy=policy -addmods java.smartcardio TerminalFactorySpiTest
+ * @compile --add-modules=java.smartcardio TerminalFactorySpiTest.java
+ * @run main/othervm/java.security.policy=policy --add-modules=java.smartcardio TerminalFactorySpiTest
  */
 import java.security.Provider;
 import java.security.Security;
--- a/jdk/test/javax/smartcardio/TestCardPermission.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/javax/smartcardio/TestCardPermission.java	Wed Aug 10 15:51:25 2016 -0700
@@ -26,8 +26,8 @@
  * @bug 6293767
  * @summary Test for the CardPermission class
  * @author Andreas Sterbenz
- * @compile -addmods java.smartcardio TestCardPermission.java
- * @run main/othervm -addmods java.smartcardio TestCardPermission
+ * @compile --add-modules=java.smartcardio TestCardPermission.java
+ * @run main/othervm --add-modules=java.smartcardio TestCardPermission
  */
 
 import javax.smartcardio.*;
--- a/jdk/test/javax/smartcardio/TestCommandAPDU.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/javax/smartcardio/TestCommandAPDU.java	Wed Aug 10 15:51:25 2016 -0700
@@ -27,8 +27,8 @@
  * @summary Test for the CommandAPDU class
  * @author Andreas Sterbenz
  * @key randomness
- * @compile -addmods java.smartcardio TestCommandAPDU.java
- * @run main/othervm -addmods java.smartcardio TestCommandAPDU
+ * @compile --add-modules=java.smartcardio TestCommandAPDU.java
+ * @run main/othervm --add-modules=java.smartcardio TestCommandAPDU
  */
 
 import java.util.*;
--- a/jdk/test/javax/transaction/testng/Driver.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/javax/transaction/testng/Driver.java	Wed Aug 10 15:51:25 2016 -0700
@@ -24,14 +24,14 @@
 /**
  * @test
  * @modules java.sql java.transaction
- * @compile -addmods java.transaction
+ * @compile
  *   test/transaction/InvalidTransactionExceptionTests.java
  *   test/transaction/TransactionRequiredExceptionTests.java
  *   test/transaction/TransactionRolledbackExceptionTests.java
  *   test/transaction/XAExceptionTests.java
  *   util/SerializedTransactionExceptions.java
- * @run testng/othervm -addmods java.transaction test.transaction.InvalidTransactionExceptionTests
- * @run testng/othervm -addmods java.transaction test.transaction.TransactionRequiredExceptionTests
- * @run testng/othervm -addmods java.transaction test.transaction.TransactionRolledbackExceptionTests
- * @run testng/othervm -addmods java.transaction util.SerializedTransactionExceptions
+ * @run testng/othervm test.transaction.InvalidTransactionExceptionTests
+ * @run testng/othervm test.transaction.TransactionRequiredExceptionTests
+ * @run testng/othervm test.transaction.TransactionRolledbackExceptionTests
+ * @run testng/othervm util.SerializedTransactionExceptions
  */
--- a/jdk/test/javax/xml/bind/JAXBContext/JAXBContextWithAbstractFactory.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/javax/xml/bind/JAXBContext/JAXBContextWithAbstractFactory.java	Wed Aug 10 15:51:25 2016 -0700
@@ -33,8 +33,8 @@
  * @bug 8150173
  * @summary Verifies that a factory which inherit its createContext method
  *          from an abstract subclass of JAXBContextFactory can be instantiated.
- * @compile -addmods java.xml.bind JAXBContextWithAbstractFactory.java
- * @run main/othervm -addmods java.xml.bind JAXBContextWithAbstractFactory
+ * @modules java.xml.bind
+ * @run main/othervm JAXBContextWithAbstractFactory
  */
 public class JAXBContextWithAbstractFactory {
     private static JAXBContext tmp;
--- a/jdk/test/javax/xml/bind/JAXBContext/JAXBContextWithLegacyFactory.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/javax/xml/bind/JAXBContext/JAXBContextWithLegacyFactory.java	Wed Aug 10 15:51:25 2016 -0700
@@ -35,8 +35,8 @@
  * @bug 8150173
  * @summary Verifies that a JAXBContext can be created with a legacy
  *          factory class that has static createContext methods.
- * @compile -addmods java.xml.bind JAXBContextWithLegacyFactory.java
- * @run main/othervm -addmods java.xml.bind JAXBContextWithLegacyFactory
+ * @modules java.xml.bind
+ * @run main/othervm JAXBContextWithLegacyFactory
  */
 public class JAXBContextWithLegacyFactory {
     private static JAXBContext tmp;
--- a/jdk/test/javax/xml/bind/JAXBContext/JAXBContextWithSubclassedFactory.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/javax/xml/bind/JAXBContext/JAXBContextWithSubclassedFactory.java	Wed Aug 10 15:51:25 2016 -0700
@@ -36,8 +36,8 @@
  * @bug 8150173
  * @summary Verifies that a factory which inherit its createContext method
  *          from a concrete subclass of JAXBContextFactory is be instantiated.
- * @compile -addmods java.xml.bind JAXBContextWithSubclassedFactory.java
- * @run main/othervm -addmods java.xml.bind JAXBContextWithSubclassedFactory
+ * @modules java.xml.bind
+ * @run main/othervm JAXBContextWithSubclassedFactory
  */
 public class JAXBContextWithSubclassedFactory {
     static JAXBContext tmp;
--- a/jdk/test/javax/xml/bind/jxc/8073872/SchemagenStackOverflow.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/javax/xml/bind/jxc/8073872/SchemagenStackOverflow.java	Wed Aug 10 15:51:25 2016 -0700
@@ -26,9 +26,8 @@
  * @bug 8073872
  * @summary test that stackoverflow is not observable when element
  *          references containing class
- * @modules java.xml
  * @modules java.xml.bind
- * @compile Foo.java
+ * @compile SchemagenStackOverflow.java Foo.java
  * @run testng/othervm SchemagenStackOverflow
  */
 
--- a/jdk/test/javax/xml/bind/marshal/8134111/UnmarshalTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/javax/xml/bind/marshal/8134111/UnmarshalTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -26,9 +26,10 @@
  * @bug 8134111
  * @summary test that elements without namespace is ignored by unmarshaller
  *          when elementFormDefault is set to QUALIFIED.
- * @compile testTypes/package-info.java testTypes/Root.java
+ * @modules java.xml.bind
+ * @compile UnmarshalTest.java
+ *          testTypes/package-info.java testTypes/Root.java
  *          testTypes/WhenType.java testTypes/ObjectFactory.java
- * @modules java.xml.bind
  * @run testng/othervm UnmarshalTest
  */
 
--- a/jdk/test/javax/xml/bind/xjc/8032884/XjcOptionalPropertyTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/javax/xml/bind/xjc/8032884/XjcOptionalPropertyTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -100,7 +100,7 @@
     // Compile java classes with javac tool
     void compileXjcGeneratedClasses() throws Exception {
         JDKToolLauncher javacLauncher = JDKToolLauncher.createUsingTestJDK("javac");
-        javacLauncher.addToolArg("-addmods");
+        javacLauncher.addToolArg("--add-modules");
         javacLauncher.addToolArg("java.xml.bind");
         javacLauncher.addToolArg(xjcResultDir.resolve("Foo.java").toString());
         System.out.println("Compiling xjc generated class: " + Arrays.asList(javacLauncher.getCommand()));
--- a/jdk/test/javax/xml/bind/xjc/8145039/JaxbMarshallTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/javax/xml/bind/xjc/8145039/JaxbMarshallTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -127,7 +127,7 @@
     // Compile java classes with javac tool
     void compileXjcGeneratedClasses() throws Exception {
         JDKToolLauncher javacLauncher = JDKToolLauncher.createUsingTestJDK("javac");
-        javacLauncher.addToolArg("-addmods");
+        javacLauncher.addToolArg("--add-modules");
         javacLauncher.addToolArg("java.xml.bind");
         javacLauncher.addToolArg(xjcResultDir.resolve("ObjectFactory.java").toString());
         javacLauncher.addToolArg(xjcResultDir.resolve("TypesLongList.java").toString());
--- a/jdk/test/javax/xml/jaxp/common/8035437/run.sh	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/javax/xml/jaxp/common/8035437/run.sh	Wed Aug 10 15:51:25 2016 -0700
@@ -34,12 +34,12 @@
    -d compile/java.xml -Xmodule:java.xml $TESTSRC/Document.java $TESTSRC/Node.java || exit 1
 
 $COMPILEJAVA/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \
-   -d exec/java.xml -Xpatch:java.xml=compile/java.xml -Xmodule:java.xml $TESTSRC/DocumentImpl.java || exit 2
+   -d exec/java.xml --patch-module java.xml=compile/java.xml -Xmodule:java.xml $TESTSRC/DocumentImpl.java || exit 2
 
 $COMPILEJAVA/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \
    $TESTSRC/AbstractMethodErrorTest.java -d exec || exit 3
 
-$TESTJAVA/bin/java ${TESTVMOPTS} -Xpatch:java.xml=exec -cp exec AbstractMethodErrorTest || exit 4
+$TESTJAVA/bin/java ${TESTVMOPTS} --patch-module java.xml=exec -cp exec AbstractMethodErrorTest || exit 4
 
 exit 0
 
--- a/jdk/test/javax/xml/soap/XmlTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/javax/xml/soap/XmlTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -38,8 +38,8 @@
 
 /*
  * @test
- * @compile -addmods java.xml.ws XmlTest.java
- * @run main/othervm -addmods java.xml.ws XmlTest
+ * @modules java.xml.ws
+ * @run main XmlTest
  * @summary tests JAF DataHandler can be instantiated; test serialize and
  *   deserialize SOAP message containing xml attachment
  */
--- a/jdk/test/javax/xml/soap/spi/SAAJFactoryTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/javax/xml/soap/spi/SAAJFactoryTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -50,28 +50,28 @@
  *      scenario14 javax.xml.soap.MessageFactory=saaj.factory.Valid saaj.factory.Valid2 -
  *
  * @modules java.xml.ws
- * @compile -addmods java.xml.ws saaj/factory/Invalid.java saaj/factory/Valid.java
+ * @compile saaj/factory/Invalid.java saaj/factory/Valid.java
  *     saaj/factory/Valid2.java saaj/factory/Valid3.java SAAJFactoryTest.java
  *
- * @run main/othervm -addmods java.xml.ws
+ * @run main/othervm
  *      SAAJFactoryTest com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl - scenario2 - -
- * @run main/othervm -addmods java.xml.ws -Djavax.xml.soap.MessageFactory=saaj.factory.Valid
+ * @run main/othervm -Djavax.xml.soap.MessageFactory=saaj.factory.Valid
  *      SAAJFactoryTest saaj.factory.Valid - scenario5 - -
- * @run main/othervm -addmods java.xml.ws -Djavax.xml.soap.MessageFactory=saaj.factory.NonExisting
+ * @run main/othervm -Djavax.xml.soap.MessageFactory=saaj.factory.NonExisting
  *      SAAJFactoryTest - javax.xml.soap.SOAPException scenario6 - -
- * @run main/othervm -addmods java.xml.ws -Djavax.xml.soap.MessageFactory=saaj.factory.Invalid
+ * @run main/othervm -Djavax.xml.soap.MessageFactory=saaj.factory.Invalid
  *      SAAJFactoryTest - javax.xml.soap.SOAPException scenario7 - -
- * @run main/othervm  -addmods java.xml.ws
+ * @run main/othervm
  *      SAAJFactoryTest saaj.factory.Valid - scenario8 - saaj.factory.Valid
- * @run main/othervm -addmods java.xml.ws
+ * @run main/othervm
  *      SAAJFactoryTest saaj.factory.Valid - scenario9 - saaj.factory.Valid
- * @run main/othervm -addmods java.xml.ws
+ * @run main/othervm
  *      SAAJFactoryTest - javax.xml.soap.SOAPException scenario10 - saaj.factory.NonExisting
- * @run main/othervm -addmods java.xml.ws
+ * @run main/othervm
  *      SAAJFactoryTest - javax.xml.soap.SOAPException scenario11 - saaj.factory.Invalid scenario11 - saaj.factory.Invalid
- * @run main/othervm  -addmods java.xml.ws
+ * @run main/othervm
  *      SAAJFactoryTest com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl - scenario12 - -
- * @run main/othervm -addmods java.xml.ws
+ * @run main/othervm
  *      SAAJFactoryTest saaj.factory.Valid - scenario15 - saaj.factory.Valid
  */
 public class SAAJFactoryTest {
@@ -207,4 +207,3 @@
     }
 
 }
-
--- a/jdk/test/javax/xml/ws/8043129/MailTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/javax/xml/ws/8043129/MailTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -28,8 +28,7 @@
  * @author mkos
  * @library javax.mail.jar
  * @modules java.xml.ws
- * @compile -addmods java.xml.ws MailTest.java
- * @run main/othervm -addmods java.xml.ws MailTest
+ * @run main MailTest
  */
 
 import javax.activation.CommandMap;
--- a/jdk/test/javax/xml/ws/clientjar/TestWsImport.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/javax/xml/ws/clientjar/TestWsImport.java	Wed Aug 10 15:51:25 2016 -0700
@@ -25,8 +25,8 @@
  * @test
  * @bug 8016271 8026405
  * @summary wsimport -clientjar does not create portable jar on windows due to hardcoded '\'
- * @compile -addmods java.xml.ws TestWsImport.java
- * @run main/othervm -addmods java.xml.ws TestWsImport
+ * @modules java.xml.ws
+ * @run main TestWsImport
  */
 
 import javax.xml.namespace.QName;
--- a/jdk/test/javax/xml/ws/publish/WSTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/javax/xml/ws/publish/WSTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -26,8 +26,7 @@
  * @bug 8146086
  * @summary Publishing two webservices on same port fails with "java.net.BindException: Address already in use"
  * @modules java.xml.ws
- * @compile -addmods java.xml.ws WSTest.java
- * @run main/othervm -addmods java.xml.ws WSTest
+ * @run main/othervm WSTest
  */
 import javax.jws.WebMethod;
 import javax.jws.WebService;
--- a/jdk/test/javax/xml/ws/xsanymixed/Test.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/javax/xml/ws/xsanymixed/Test.java	Wed Aug 10 15:51:25 2016 -0700
@@ -28,8 +28,7 @@
  *          no white space changes and no changes to namespace prefixes
  * @modules java.xml.ws
  * @run shell compile-wsdl.sh
- * @compile -addmods java.xml.ws Test.java
- * @run main/othervm -addmods java.xml.ws Test
+ * @run main/othervm Test
  */
 
 import com.sun.net.httpserver.HttpServer;
--- a/jdk/test/jdk/internal/misc/VM/RuntimeArguments.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/jdk/internal/misc/VM/RuntimeArguments.java	Wed Aug 10 15:51:25 2016 -0700
@@ -26,6 +26,8 @@
  * @summary Basic test of VM::getRuntimeArguments
  * @library /lib/testlibrary
  * @modules java.base/jdk.internal.misc
+ *          java.compact3
+ *          jdk.zipfs
  * @run testng RuntimeArguments
  */
 
@@ -45,21 +47,28 @@
     public Object[][] options() {
         return new Object[][] {
             { // CLI options
-              List.of("-XaddExports:java.base/jdk.internal.misc=ALL-UNNAMED",
-                      "-XaddExports:java.base/jdk.internal.perf=ALL-UNNAMED",
-                      "-addmods", "jdk.zipfs"),
+              List.of("--add-exports",
+                      "java.base/jdk.internal.misc=ALL-UNNAMED",
+                      "--add-exports",
+                      "java.base/jdk.internal.perf=ALL-UNNAMED",
+                      "--add-modules",
+                      "jdk.zipfs"),
               // expected runtime arguments
-              List.of("-Djdk.launcher.addexports.0=java.base/jdk.internal.misc=ALL-UNNAMED",
-                      "-Djdk.launcher.addexports.1=java.base/jdk.internal.perf=ALL-UNNAMED",
-                      "-Djdk.launcher.addmods=jdk.zipfs")
+              List.of("--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED",
+                      "--add-exports=java.base/jdk.internal.perf=ALL-UNNAMED",
+                      "--add-modules=jdk.zipfs")
             },
             { // CLI options
-              List.of("-XaddExports:java.base/jdk.internal.misc=ALL-UNNAMED",
-                      "-addmods", "jdk.zipfs",
-                      "-limitmods", "java.compact3"),
+              List.of("--add-exports",
+                      "java.base/jdk.internal.misc=ALL-UNNAMED",
+                      "--add-modules",
+                      "jdk.zipfs",
+                      "--limit-modules",
+                      "java.compact3"),
               // expected runtime arguments
-              List.of("-Djdk.launcher.addexports.0=java.base/jdk.internal.misc=ALL-UNNAMED",
-                      "-Djdk.launcher.addmods=jdk.zipfs", "-Djdk.launcher.limitmods=java.compact3")
+              List.of("--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED",
+                      "--add-modules=jdk.zipfs",
+                      "--limit-modules=java.compact3"),
             },
         };
     };
--- a/jdk/test/jdk/internal/reflect/Reflection/GetCallerClassTest.sh	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/jdk/internal/reflect/Reflection/GetCallerClassTest.sh	Wed Aug 10 15:51:25 2016 -0700
@@ -55,7 +55,7 @@
 rm -rf ${BCP}
 mkdir ${BCP}
 
-EXTRAOPTS="-XaddExports:java.base/jdk.internal.reflect=ALL-UNNAMED"
+EXTRAOPTS="--add-exports java.base/jdk.internal.reflect=ALL-UNNAMED"
 
 # Compile GetCallerClass in bootclasspath
 ${COMPILEJAVA}/bin/javac ${TESTTOOLVMOPTS} ${EXTRAOPTS} \
--- a/jdk/test/jdk/modules/etc/VerifyModuleDelegation.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/jdk/modules/etc/VerifyModuleDelegation.java	Wed Aug 10 15:51:25 2016 -0700
@@ -26,7 +26,7 @@
  * @summary Verify the defining class loader of each module never delegates
  *          to its child class loader. Also sanity check java.compact2
  *          requires.
- * @run testng/othervm -Djdk.launcher.addmods=ALL-SYSTEM VerifyModuleDelegation
+ * @run testng/othervm --add-modules=ALL-SYSTEM VerifyModuleDelegation
  */
 
 import java.lang.module.ModuleDescriptor;
@@ -51,11 +51,11 @@
 
     private static final ModuleDescriptor COMPACT2
         = new ModuleDescriptor.Builder(JAVA_COMPACT2)
-            .requires(MANDATED, JAVA_BASE)
-            .requires(PUBLIC, JAVA_COMPACT1)
-            .requires(PUBLIC, "java.rmi")
-            .requires(PUBLIC, "java.sql")
-            .requires(PUBLIC, "java.xml")
+            .requires(Set.of(MANDATED), JAVA_BASE)
+            .requires(Set.of(PUBLIC), JAVA_COMPACT1)
+            .requires(Set.of(PUBLIC), "java.rmi")
+            .requires(Set.of(PUBLIC), "java.sql")
+            .requires(Set.of(PUBLIC), "java.xml")
             .build();
 
     private static final Set<ModuleReference> MREFS
--- a/jdk/test/jdk/modules/scenarios/automaticmodules/RunWithAutomaticModules.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/jdk/modules/scenarios/automaticmodules/RunWithAutomaticModules.java	Wed Aug 10 15:51:25 2016 -0700
@@ -100,15 +100,15 @@
         compiled = CompilerUtils
             .compile(SRC_DIR.resolve(testModule),
                     MODS_DIR.resolve(testModule),
-                    "-mp", MODS_DIR.toString());
+                    "--module-path", MODS_DIR.toString());
         assertTrue(compiled);
 
 
-        // launch the test. Need -addmods because nothing explicitly depends on logging
+        // launch the test. Need --add-mdoules because nothing explicitly depends on logging
 
         int exitValue
-            = executeTestJava("-mp", MODS_DIR.toString(),
-                              "-addmods", "logging",
+            = executeTestJava("--module-path", MODS_DIR.toString(),
+                              "--add-modules", "logging",
                               "-m", testModule + "/" + mainClass)
                 .outputTo(System.out)
                 .errorTo(System.out)
@@ -159,7 +159,7 @@
         compiled = CompilerUtils
                 .compile(SRC_DIR.resolve(testModule),
                         MODS_DIR.resolve(testModule),
-                        "-mp", MODS_DIR.toString());
+                        "--module-path", MODS_DIR.toString());
 
         assertTrue(compiled);
 
@@ -167,7 +167,7 @@
         // launch the test
 
         int exitValue
-            = executeTestJava("-mp", MODS_DIR.toString(),
+            = executeTestJava("--module-path", MODS_DIR.toString(),
                               "-m", testModule + "/" + mainClass)
                 .outputTo(System.out)
                 .errorTo(System.out)
--- a/jdk/test/jdk/modules/scenarios/container/ContainerTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/jdk/modules/scenarios/container/ContainerTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -98,7 +98,7 @@
 
         compiled = CompilerUtils.compile(SRC_DIR.resolve("app1"),
                                          dir.resolve("app1"),
-                                         "-upgrademodulepath", dir.toString());
+                                         "--upgrade-module-path", dir.toString());
         assertTrue(compiled);
     }
 
@@ -116,7 +116,7 @@
 
         compiled = CompilerUtils.compile(SRC_DIR.resolve("app2"),
                                          dir.resolve("app2"),
-                                         "-mp", dir.toString());
+                                         "--module-path", dir.toString());
         assertTrue(compiled);
     }
 
@@ -134,7 +134,7 @@
     public void testContainer() throws Exception {
 
         int exitValue
-            = executeTestJava("-mp", MLIB_DIR.toString(),
+            = executeTestJava("--module-path", MLIB_DIR.toString(),
                               "-m", CONTAINER_MODULE)
                 .outputTo(System.out)
                 .errorTo(System.err)
--- a/jdk/test/jdk/modules/scenarios/overlappingpackages/OverlappingPackagesTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/jdk/modules/scenarios/overlappingpackages/OverlappingPackagesTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -74,7 +74,7 @@
      */
     public void testNoOverlappingPackages() throws Exception {
         int exitValue
-            = executeTestJava("-mp", MODS_DIR.toString(),
+            = executeTestJava("--module-path", MODS_DIR.toString(),
                               "-m", "test/test.Main")
                 .outputTo(System.out)
                 .errorTo(System.err)
@@ -85,13 +85,13 @@
 
 
     /**
-     * Run the test with "-addmods misc", the misc module has package
+     * Run the test with "--add-modules misc", the misc module has package
      * jdk.internal.misc and so should overlap with the base module.
      */
     public void testOverlapWithBaseModule() throws Exception {
         int exitValue
-            = executeTestJava("-mp", MODS_DIR.toString(),
-                              "-addmods", "misc",
+            = executeTestJava("--module-path", MODS_DIR.toString(),
+                              "-add-modules", "misc",
                               "-m", "test/test.Main")
                 .outputTo(System.out)
                 .errorTo(System.err)
@@ -101,12 +101,12 @@
     }
 
     /**
-     * Run the test with "-addmods m1,m2". Both modules have package p.
+     * Run the test with "--add-modules m1,m2". Both modules have package p.
      */
     public void testOverlap() throws Exception {
         int exitValue
-            = executeTestJava("-mp", MODS_DIR.toString(),
-                              "-addmods", "m1,m2",
+            = executeTestJava("--module-path", MODS_DIR.toString(),
+                              "--add-modules", "m1,m2",
                               "-m", "test/test.Main")
                 .outputTo(System.out)
                 .errorTo(System.err)
--- a/jdk/test/sun/awt/shell/ShellFolderMemoryLeak.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/sun/awt/shell/ShellFolderMemoryLeak.java	Wed Aug 10 15:51:25 2016 -0700
@@ -93,7 +93,7 @@
         String command = javaPath + File.separator + "bin" + File.separator
                 + "java -Xmx256M" + arg1 + " -cp "
                 + classPathDir
-                + " -XaddExports:java.desktop/sun.awt.shell=ALL-UNNAMED"
+                + " --add-exports=java.desktop/sun.awt.shell=ALL-UNNAMED"
                 + " ShellFolderMemoryLeak " + arg2;
         process = Runtime.getRuntime().exec(command);
         BufferedReader input = null;
--- a/jdk/test/sun/management/jmxremote/bootstrap/CustomLauncherTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/sun/management/jmxremote/bootstrap/CustomLauncherTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -150,7 +150,7 @@
             ProcessBuilder client = ProcessTools.createJavaProcessBuilder(
                 "-cp",
                 TEST_CLASSPATH,
-                "-XaddExports:java.management/sun.management=ALL-UNNAMED",
+                "--add-exports", "java.management/sun.management=ALL-UNNAMED",
                 "TestManager",
                 String.valueOf(serverPrc.getPid()),
                 port.get(),
--- a/jdk/test/sun/management/jmxremote/bootstrap/LocalManagementTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/sun/management/jmxremote/bootstrap/LocalManagementTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -131,7 +131,7 @@
             ProcessBuilder client = ProcessTools.createJavaProcessBuilder(
                 "-cp",
                 TEST_CLASSPATH,
-                "-XaddExports:java.management/sun.management=ALL-UNNAMED",
+                "--add-exports", "java.management/sun.management=ALL-UNNAMED",
                 "TestManager",
                 String.valueOf(serverPrc.getPid()),
                 port.get(),
--- a/jdk/test/sun/management/jmxremote/bootstrap/RmiBootstrapTest.sh	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/sun/management/jmxremote/bootstrap/RmiBootstrapTest.sh	Wed Aug 10 15:51:25 2016 -0700
@@ -51,8 +51,8 @@
 DEBUGOPTIONS=""
 export DEBUGOPTIONS
 
-EXTRAOPTIONS="-XaddExports:java.management/sun.management=ALL-UNNAMED \
- -XaddExports:java.management/sun.management.jmxremote=ALL-UNNAMED"
+EXTRAOPTIONS="--add-exports java.management/sun.management=ALL-UNNAMED \
+ --add-exports java.management/sun.management.jmxremote=ALL-UNNAMED"
 export EXTRAOPTIONS
 
 # Call the common generic test
--- a/jdk/test/sun/management/jmxremote/bootstrap/RmiSslBootstrapTest.sh	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/sun/management/jmxremote/bootstrap/RmiSslBootstrapTest.sh	Wed Aug 10 15:51:25 2016 -0700
@@ -49,8 +49,8 @@
 DEBUGOPTIONS=""
 export DEBUGOPTIONS
 
-EXTRAOPTIONS="-XaddExports:java.management/sun.management=ALL-UNNAMED \
- -XaddExports:java.management/sun.management.jmxremote=ALL-UNNAMED"
+EXTRAOPTIONS="--add-exports java.management/sun.management=ALL-UNNAMED \
+ --add-exports java.management/sun.management.jmxremote=ALL-UNNAMED"
 export EXTRAOPTIONS
 
 # Call the common generic test
--- a/jdk/test/sun/management/jmxremote/bootstrap/RmiSslNoKeyStoreTest.sh	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/sun/management/jmxremote/bootstrap/RmiSslNoKeyStoreTest.sh	Wed Aug 10 15:51:25 2016 -0700
@@ -48,8 +48,8 @@
 DEBUGOPTIONS=""
 export DEBUGOPTIONS
 
-EXTRAOPTIONS="-XaddExports:java.management/sun.management=ALL-UNNAMED \
- -XaddExports:java.management/sun.management.jmxremote=ALL-UNNAMED"
+EXTRAOPTIONS="--add-exports java.management/sun.management=ALL-UNNAMED \
+ --add-exports java.management/sun.management.jmxremote=ALL-UNNAMED"
 export EXTRAOPTIONS
 
 # Call the common generic test
--- a/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxy.sh	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxy.sh	Wed Aug 10 15:51:25 2016 -0700
@@ -51,7 +51,7 @@
     ;;
 esac
 
-EXTRAOPTS="-XaddExports:java.base/sun.net.www=ALL-UNNAMED"
+EXTRAOPTS="--add-exports java.base/sun.net.www=ALL-UNNAMED"
 
 ${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} ${EXTRAOPTS} -d . \
     ${TESTSRC}${FS}OriginServer.java \
--- a/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxyWithAuth.sh	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxyWithAuth.sh	Wed Aug 10 15:51:25 2016 -0700
@@ -51,7 +51,7 @@
     ;;
 esac
 
-EXTRAOPTS="-XaddExports:java.base/sun.net.www=ALL-UNNAMED"
+EXTRAOPTS="--add-exports java.base/sun.net.www=ALL-UNNAMED"
 ${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} ${EXTRAOPTS} \
     -d . ${TESTSRC}${FS}OriginServer.java \
     ${TESTSRC}${FS}ProxyTunnelServer.java \
--- a/jdk/test/sun/net/www/protocol/jrt/OtherResources.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/sun/net/www/protocol/jrt/OtherResources.java	Wed Aug 10 15:51:25 2016 -0700
@@ -36,7 +36,7 @@
         // check that java.desktop is not in the set of readable modules
         try {
             Class.forName("java.awt.Component");
-            throw new RuntimeException("Need to run with -limitmods java.base");
+            throw new RuntimeException("Need to run with --limit-modules java.base");
         } catch (ClassNotFoundException expected) { }
 
         // access resource in the java.desktop module
--- a/jdk/test/sun/net/www/protocol/jrt/other_resources.sh	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/sun/net/www/protocol/jrt/other_resources.sh	Wed Aug 10 15:51:25 2016 -0700
@@ -26,7 +26,7 @@
 # @run shell other_resources.sh
 # @summary Access a jrt:/ resource in an observable module that is not in
 #  the boot layer and hence not known to the built-in class loaders. This
-#  test is a shell test because the run tag doesn't support -limitmods.
+#  test is a shell test because the run tag doesn't support --limit-modules.
 
 set -e
 
@@ -39,7 +39,7 @@
 fi
 
 JAVA="$TESTJAVA/bin/java ${TESTVMOPTS}"
-$JAVA -limitmods java.base -cp $TESTCLASSES OtherResources
+$JAVA --limit-modules java.base -cp $TESTCLASSES OtherResources
 
 exit 0
 
--- a/jdk/test/sun/rmi/rmic/iiopCompilation/IIOPCompilation.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/sun/rmi/rmic/iiopCompilation/IIOPCompilation.java	Wed Aug 10 15:51:25 2016 -0700
@@ -30,8 +30,9 @@
  *          java.rmi/sun.rmi.transport
  *          java.rmi/sun.rmi.transport.tcp
  * @build TestLibrary
+ * @run main IIOPCompilation
+ *
  * @summary Compiles a PortableRemoteObject with rmic -iiop and ensures that stub and tie classes are generated.
- * @run main IIOPCompilation
  * @author Felix Yang
  *
  */
--- a/jdk/test/sun/rmi/runtime/Log/6409194/NoConsoleOutput.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/sun/rmi/runtime/Log/6409194/NoConsoleOutput.java	Wed Aug 10 15:51:25 2016 -0700
@@ -68,10 +68,10 @@
         // (neither on standard output, nor on standard err streams).
         JavaVM vm = new JavaVM(
                 DoRMIStuff.class.getName(),
-                "-XaddExports:java.rmi/sun.rmi.registry=ALL-UNNAMED"
-                + " -XaddExports:java.rmi/sun.rmi.server=ALL-UNNAMED"
-                + " -XaddExports:java.rmi/sun.rmi.transport=ALL-UNNAMED"
-                + " -XaddExports:java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED"
+                "--add-exports=java.rmi/sun.rmi.registry=ALL-UNNAMED"
+                + " --add-exports=java.rmi/sun.rmi.server=ALL-UNNAMED"
+                + " --add-exports=java.rmi/sun.rmi.transport=ALL-UNNAMED"
+                + " --add-exports=java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED"
                 + " -Djava.util.logging.config.file="
                 + loggingPropertiesFile, "", out, err);
         vm.execute();
--- a/jdk/test/sun/security/krb5/ccache/EmptyCC.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/sun/security/krb5/ccache/EmptyCC.java	Wed Aug 10 15:51:25 2016 -0700
@@ -27,7 +27,8 @@
  * @bug 8001208
  * @summary NPE in sun.security.krb5.Credentials.acquireDefaultCreds()
  * @library ../../../../java/security/testlibrary/
- * @modules java.security.jgss/sun.security.krb5
+ * @modules java.base/jdk.internal.misc
+ *          java.security.jgss/sun.security.krb5
  *          java.security.jgss/sun.security.krb5.internal.ccache
  * @compile -XDignore.symbol.file EmptyCC.java
  * @run main EmptyCC tmpcc
--- a/jdk/test/sun/security/krb5/tools/ktcheck.sh	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/sun/security/krb5/tools/ktcheck.sh	Wed Aug 10 15:51:25 2016 -0700
@@ -61,8 +61,8 @@
 EXTRA_OPTIONS="-Djava.security.krb5.conf=${TESTSRC}${FS}onlythree.conf"
 KTAB="${TESTJAVA}${FS}bin${FS}ktab -J${EXTRA_OPTIONS} -k $KEYTAB -f"
 CHECK="${TESTJAVA}${FS}bin${FS}java -cp ${TESTCLASSES} ${TESTVMOPTS} ${EXTRA_OPTIONS} \
-        -XaddExports:java.security.jgss/sun.security.krb5.internal.ktab=ALL-UNNAMED \
-        -XaddExports:java.security.jgss/sun.security.krb5=ALL-UNNAMED \
+        --add-exports java.security.jgss/sun.security.krb5.internal.ktab=ALL-UNNAMED \
+        --add-exports java.security.jgss/sun.security.krb5=ALL-UNNAMED \
         KtabCheck $KEYTAB"
 
 echo ${EXTRA_OPTIONS}
--- a/jdk/test/sun/security/mscapi/PublicKeyInterop.sh	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/sun/security/mscapi/PublicKeyInterop.sh	Wed Aug 10 15:51:25 2016 -0700
@@ -62,9 +62,9 @@
 
         echo
         echo "Running the test..."
-        ${TESTJAVA}/bin/javac -XaddExports:java.base/sun.security.util=ALL-UNNAMED \
+        ${TESTJAVA}/bin/javac --add-exports java.base/sun.security.util=ALL-UNNAMED \
             ${TESTTOOLVMOPTS} ${TESTJAVACOPTS} -d . ${TESTSRC}\\PublicKeyInterop.java
-        ${TESTJAVA}/bin/java -XaddExports:java.base/sun.security.util=ALL-UNNAMED \
+        ${TESTJAVA}/bin/java --add-exports java.base/sun.security.util=ALL-UNNAMED \
             ${TESTVMOPTS} PublicKeyInterop
 
         rc=$?
--- a/jdk/test/sun/security/mscapi/ShortRSAKey1024.sh	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/sun/security/mscapi/ShortRSAKey1024.sh	Wed Aug 10 15:51:25 2016 -0700
@@ -88,10 +88,10 @@
 
         echo
         echo "Running the test..."
-        ${TESTJAVA}${FS}bin${FS}javac -XaddExports:java.base/sun.security.util=ALL-UNNAMED \
+        ${TESTJAVA}${FS}bin${FS}javac --add-exports java.base/sun.security.util=ALL-UNNAMED \
             ${TESTTOOLVMOPTS} ${TESTJAVACOPTS} -d . \
             ${TESTSRC}${FS}ShortRSAKeyWithinTLS.java
-        ${TESTJAVA}${FS}bin${FS}java -XaddExports:java.base/sun.security.util=ALL-UNNAMED \
+        ${TESTJAVA}${FS}bin${FS}java --add-exports java.base/sun.security.util=ALL-UNNAMED \
             ${TESTVMOPTS} ShortRSAKeyWithinTLS 7106773.$BITS $BITS \
             TLSv1.2 TLS_DHE_RSA_WITH_AES_128_CBC_SHA
 
--- a/jdk/test/sun/security/provider/PolicyFile/Modules.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/sun/security/provider/PolicyFile/Modules.java	Wed Aug 10 15:51:25 2016 -0700
@@ -33,14 +33,14 @@
  *          java.sql
  *          java.xml
  *          java.xml.bind
+ *          java.xml.ws
  *          jdk.attach
  *          jdk.jdi
  *          jdk.net
  *          jdk.security.auth
  *          jdk.security.jgss
- * @compile -addmods java.xml.ws,java.smartcardio Modules.java
- * @run main/othervm/java.security.policy==modules.policy
- *     -addmods java.xml.ws,java.smartcardio Modules
+ * @compile --add-modules=java.xml.ws,java.smartcardio Modules.java
+ * @run main/othervm/java.security.policy==modules.policy Modules
  */
 
 import java.security.AccessController;
--- a/jdk/test/sun/security/tools/jarsigner/AltProvider.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/sun/security/tools/jarsigner/AltProvider.java	Wed Aug 10 15:51:25 2016 -0700
@@ -55,7 +55,7 @@
         // Compile the provider
         CompilerUtils.compile(
                 MOD_SRC_DIR, MOD_DEST_DIR,
-                "-modulesourcepath",
+                "--module-source-path",
                 MOD_SRC_DIR.toString());
 
         // Create a keystore
@@ -102,22 +102,22 @@
                 0, "loadProviderByClass: org.test.dummy.DummyProvider");
 
         // name in a module
-        testBoth("-J-mp -Jmods " +
+        testBoth("-J--module-path=mods " +
                 "-addprovider Dummy -providerArg full",
                 0, "loadProviderByName: Dummy");
 
         // -providerClass does not work
-        testBoth("-J-mp -Jmods " +
+        testBoth("-J--module-path=mods " +
                 "-providerClass org.test.dummy.DummyProvider -providerArg full",
                 1, "Provider \"org.test.dummy.DummyProvider\" not found");
 
         // -addprovider with class does not work
-        testBoth("-J-mp -Jmods " +
+        testBoth("-J--module-path=mods " +
                 "-addprovider org.test.dummy.DummyProvider -providerArg full",
                 1, "Provider named \"org.test.dummy.DummyProvider\" not found");
 
         // -addprovider without arg does not work
-        testBoth("-J-mp -Jmods " +
+        testBoth("-J--module-path=mods " +
                 "-addprovider Dummy",
                 1, "DUMMYKS not found");
     }
--- a/jdk/test/sun/security/tools/jarsigner/ts.sh	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/sun/security/tools/jarsigner/ts.sh	Wed Aug 10 15:51:25 2016 -0700
@@ -94,10 +94,10 @@
         $KT -alias ca -gencert -ext eku:critical=cs | \
         $KT -alias tsbad3 -importcert
 
-EXTRAOPTS="-XaddExports:java.base/sun.security.pkcs=ALL-UNNAMED \
- -XaddExports:java.base/sun.security.timestamp=ALL-UNNAMED \
- -XaddExports:java.base/sun.security.x509=ALL-UNNAMED \
- -XaddExports:java.base/sun.security.util=ALL-UNNAMED"
+EXTRAOPTS="--add-exports java.base/sun.security.pkcs=ALL-UNNAMED \
+ --add-exports java.base/sun.security.timestamp=ALL-UNNAMED \
+ --add-exports java.base/sun.security.x509=ALL-UNNAMED \
+ --add-exports java.base/sun.security.util=ALL-UNNAMED"
 $JAVAC ${EXTRAOPTS} -d . ${TESTSRC}/TimestampCheck.java
 $JAVA ${TESTVMOPTS} ${EXTRAOPTS} "-Dtest.tool.vm.opts=${TESTTOOLVMOPTS}" TimestampCheck
 
--- a/jdk/test/sun/security/tools/keytool/autotest.sh	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/sun/security/tools/keytool/autotest.sh	Wed Aug 10 15:51:25 2016 -0700
@@ -100,9 +100,9 @@
 
 echo "Using NSS lib at $LIBNAME"
 
-EXTRAOPTS="-XaddExports:java.base/sun.security.tools.keytool=ALL-UNNAMED \
- -XaddExports:java.base/sun.security.util=ALL-UNNAMED \
- -XaddExports:java.base/sun.security.x509=ALL-UNNAMED"
+EXTRAOPTS="--add-exports java.base/sun.security.tools.keytool=ALL-UNNAMED \
+ --add-exports java.base/sun.security.util=ALL-UNNAMED \
+ --add-exports java.base/sun.security.x509=ALL-UNNAMED"
 
 ${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} ${EXTRAOPTS} -d . -XDignore.symbol.file \
         ${TESTSRC}${FS}KeyToolTest.java || exit 10
--- a/jdk/test/sun/security/tools/keytool/standard.sh	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/sun/security/tools/keytool/standard.sh	Wed Aug 10 15:51:25 2016 -0700
@@ -58,9 +58,9 @@
     ;;
 esac
 
-EXTRAOPTS="-XaddExports:java.base/sun.security.tools.keytool=ALL-UNNAMED \
- -XaddExports:java.base/sun.security.util=ALL-UNNAMED \
- -XaddExports:java.base/sun.security.x509=ALL-UNNAMED"
+EXTRAOPTS="--add-exports java.base/sun.security.tools.keytool=ALL-UNNAMED \
+ --add-exports java.base/sun.security.util=ALL-UNNAMED \
+ --add-exports java.base/sun.security.x509=ALL-UNNAMED"
 
 ${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} ${EXTRAOPTS} -d . -XDignore.symbol.file ${TESTSRC}${FS}KeyToolTest.java || exit 10
 
--- a/jdk/test/sun/security/validator/certreplace.sh	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/sun/security/validator/certreplace.sh	Wed Aug 10 15:51:25 2016 -0700
@@ -83,6 +83,6 @@
 
 # 5. Build and run test
 
-EXTRAOPTS="-XaddExports:java.base/sun.security.validator=ALL-UNNAMED"
+EXTRAOPTS="--add-exports java.base/sun.security.validator=ALL-UNNAMED"
 $JAVAC ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} ${EXTRAOPTS} -d . ${TESTSRC}${FS}CertReplace.java
 $JAVA ${TESTVMOPTS} ${EXTRAOPTS} CertReplace certreplace.jks certreplace.certs
--- a/jdk/test/sun/security/validator/samedn.sh	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/sun/security/validator/samedn.sh	Wed Aug 10 15:51:25 2016 -0700
@@ -79,7 +79,7 @@
 # 5. Build and run test. Make sure the CA certs are ignored for validity check.
 # Check both, one of them might be dropped out of map in old codes.
 
-EXTRAOPTS="-XaddExports:java.base/sun.security.validator=ALL-UNNAMED"
+EXTRAOPTS="--add-exports java.base/sun.security.validator=ALL-UNNAMED"
 $JAVAC ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} ${EXTRAOPTS} -d . ${TESTSRC}${FS}CertReplace.java
 $JAVA ${TESTVMOPTS} ${EXTRAOPTS} CertReplace samedn.jks samedn1.certs || exit 1
 $JAVA ${TESTVMOPTS} ${EXTRAOPTS} CertReplace samedn.jks samedn2.certs || exit 2
--- a/jdk/test/sun/text/IntHashtable/Bug4170614Test.sh	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/sun/text/IntHashtable/Bug4170614Test.sh	Wed Aug 10 15:51:25 2016 -0700
@@ -63,7 +63,7 @@
     -Xmodule:java.base \
     -d ${TEST_JAVABASE} Bug4170614Test.java
 
-${TESTJAVA}/bin/java ${TESTVMOPTS} -Xpatch:java.base=${TEST_JAVABASE} java.text.Bug4170614Test
+${TESTJAVA}/bin/java ${TESTVMOPTS} --patch-module java.base=${TEST_JAVABASE} java.text.Bug4170614Test
 
 result=$?
 
--- a/jdk/test/sun/tools/java/CFCTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/sun/tools/java/CFCTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -24,9 +24,11 @@
 /*
  * @test
  * @bug 8011805
- * @modules jdk.rmic/sun.tools.java jdk.rmic/sun.rmi.rmic
  * @summary Update sun.tools.java class file reading/writing support to include
  *   the new constant pool entries (including invokedynamic)
+ * @modules jdk.rmic/sun.rmi.rmic
+ *          jdk.rmic/sun.tools.java
+ * @run main CFCTest
  */
 
 import java.io.DataInputStream;
--- a/jdk/test/sun/util/locale/provider/Bug8038436.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/sun/util/locale/provider/Bug8038436.java	Wed Aug 10 15:51:25 2016 -0700
@@ -28,7 +28,7 @@
  * @modules java.base/sun.util.locale.provider
  *          java.base/sun.util.spi
  * @compile -XDignore.symbol.file Bug8038436.java
- * @run main/othervm  -limitmods java.base           Bug8038436  security
+ * @run main/othervm  --limit-modules java.base      Bug8038436  security
  * @run main/othervm  -Djava.locale.providers=COMPAT Bug8038436  availlocs
  */
 
@@ -69,7 +69,7 @@
 
         /*
          * Check only English/ROOT locales are returned if the jdk.localedata
-         * module is not loaded (implied by "-limitmods java.base").
+         * module is not loaded (implied by "--limit-modules java.base").
          */
         List<Locale> nonEnglishLocales= (Arrays.stream(Locale.getAvailableLocales())
                 .filter(l -> (l != Locale.ROOT && !(l.getLanguage() == "en" && (l.getCountry() == "US" || l.getCountry() == "" ))))
--- a/jdk/test/tools/jar/modularJar/Basic.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/tools/jar/modularJar/Basic.java	Wed Aug 10 15:51:25 2016 -0700
@@ -460,7 +460,7 @@
             "--no-manifest",
             "-C", barModInfo.toString(), "module-info.class")  // stuff in bar's info
             .assertSuccess();
-        jar("-p",
+        jar("-d",
             "--file=" + modularJar.toString())
             .assertSuccess()
             .resultChecker(r -> {
@@ -499,14 +499,14 @@
             "--file=" + modularJar.toString(),
             "--main-class=" + FOO.mainClass,
             "--module-version=" + FOO.version,
-            "--modulepath=" + mp.toString(),
+            "--module-path=" + mp.toString(),
             "--hash-modules=" + "bar",
             "--no-manifest",
             "-C", modClasses.toString(), ".")
             .assertSuccess();
 
         java(mp, BAR.moduleName + "/" + BAR.mainClass,
-             "-XaddExports:java.base/jdk.internal.module=bar")
+             "--add-exports", "java.base/jdk.internal.module=bar")
             .assertSuccess()
             .resultChecker(r -> {
                 assertModuleData(r, BAR);
@@ -535,7 +535,7 @@
             "--file=" + fooJar.toString(),
             "--main-class=" + FOO.mainClass,
             "--module-version=" + FOO.version,
-            "--modulepath=" + mp.toString(),
+            "-p", mp.toString(),  // test short-form
             "--hash-modules=" + "bar",
             "--no-manifest",
             "-C", fooClasses.toString(), ".").assertSuccess();
@@ -550,7 +550,7 @@
             "-C", barClasses.toString(), ".").assertSuccess();
 
         java(mp, BAR.moduleName + "/" + BAR.mainClass,
-             "-XaddExports:java.base/jdk.internal.module=bar")
+             "--add-exports", "java.base/jdk.internal.module=bar")
             .assertFailure()
             .resultChecker(r -> {
                 // Expect similar output: "java.lang.module.ResolutionException: Hash
@@ -684,7 +684,7 @@
             "-C", modClasses.toString(), ".")
             .assertSuccess();
 
-        for (String option : new String[]  {"--print-module-descriptor", "-p" }) {
+        for (String option : new String[]  {"--print-module-descriptor", "-d" }) {
             jar(option,
                 "--file=" + modularJar.toString())
                 .assertSuccess()
@@ -711,7 +711,7 @@
             "-C", modClasses.toString(), ".")
             .assertSuccess();
 
-        for (String option : new String[]  {"--print-module-descriptor", "-p" }) {
+        for (String option : new String[]  {"--print-module-descriptor", "-d" }) {
             jarWithStdin(modularJar.toFile(),
                          option)
                          .assertSuccess()
@@ -815,10 +815,12 @@
         }
         commands.add("-d");
         commands.add(dest.toString());
-        if (dest.toString().contains("bar"))
-            commands.add("-XaddExports:java.base/jdk.internal.module=bar");
+        if (dest.toString().contains("bar")) {
+            commands.add("--add-exports");
+            commands.add("java.base/jdk.internal.module=bar");
+        }
         if (modulePath != null) {
-            commands.add("-mp");
+            commands.add("--module-path");
             commands.add(modulePath.toString());
         }
         Stream.of(sourceFiles).map(Object::toString).forEach(x -> commands.add(x));
@@ -838,7 +840,7 @@
             commands.addAll(Arrays.asList(JAVA_OPTIONS.split("\\s+", -1)));
         }
         Stream.of(args).forEach(x -> commands.add(x));
-        commands.add("-mp");
+        commands.add("--module-path");
         commands.add(modulePath.toString());
         commands.add("-m");
         commands.add(entryPoint);
--- a/jdk/test/tools/jimage/VerifyJimage.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/tools/jimage/VerifyJimage.java	Wed Aug 10 15:51:25 2016 -0700
@@ -49,7 +49,7 @@
  * @test
  * @summary Verify jimage
  * @modules java.base/jdk.internal.jimage
- * @run main/othervm -Djdk.launcher.addmods=ALL-SYSTEM VerifyJimage
+ * @run main/othervm --add-modules=ALL-SYSTEM VerifyJimage
  */
 
 /**
--- a/jdk/test/tools/jlink/CustomPluginTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/tools/jlink/CustomPluginTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -93,7 +93,8 @@
         String name = "customplugin";
         Path src = Paths.get(System.getProperty("test.src")).resolve(name);
         Path classes = helper.getJmodClassesDir().resolve(name);
-        JImageGenerator.compile(src, classes, "-XaddExports:jdk.jlink/jdk.tools.jlink.internal=customplugin");
+        JImageGenerator.compile(src, classes,
+                                "--add-exports", "jdk.jlink/jdk.tools.jlink.internal=customplugin");
         return JImageGenerator.getJModTask()
                 .addClassPath(classes)
                 .jmod(helper.getJmodDir().resolve(name + ".jmod"))
--- a/jdk/test/tools/jlink/JLinkNegativeTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/tools/jlink/JLinkNegativeTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -95,7 +95,7 @@
     }
 
     public void testNotExistInAddMods() {
-        // cannot find jmod from --addmods
+        // cannot find jmod from --add-modules
         JImageGenerator.getJLinkTask()
                 .modulePath(".")
                 .addMods("not_exist")
--- a/jdk/test/tools/jlink/JLinkTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/tools/jlink/JLinkTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -118,7 +118,7 @@
                     .output(helper.createNewImageDir(moduleName))
                     .addMods("leaf1")
                     .option("")
-                    .call().assertFailure("Error: no value given for --modulepath");
+                    .call().assertFailure("Error: no value given for --module-path");
         }
 
         {
@@ -250,7 +250,7 @@
         // @file
         {
             Path path = Paths.get("embedded.properties");
-            Files.write(path, Collections.singletonList("--strip-debug --addmods " +
+            Files.write(path, Collections.singletonList("--strip-debug --add-modules " +
                     "toto.unknown --compress UNKNOWN\n"));
             String[] userOptions = {"@", path.toAbsolutePath().toString()};
             String moduleName = "configembeddednocompresscomposite2";
--- a/jdk/test/tools/jlink/basic/BasicTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/tools/jlink/basic/BasicTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -106,8 +106,8 @@
     private void runJlink(Path image, String modName, String... options) {
         List<String> args = new ArrayList<>();
         Collections.addAll(args,
-                "--modulepath", jdkMods + File.pathSeparator + jmods,
-                "--addmods", modName,
+                "--module-path", jdkMods + File.pathSeparator + jmods,
+                "--add-modules", modName,
                 "--output", image.toString());
         Collections.addAll(args, options);
         int rc = jdk.tools.jlink.internal.Main.run(args.toArray(new String[args.size()]), new PrintWriter(System.out));
--- a/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/UserModuleTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/UserModuleTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -73,7 +73,7 @@
 
         for (String mn : modules) {
             Path msrc = SRC_DIR.resolve(mn);
-            assertTrue(CompilerUtils.compile(msrc, MODS_DIR, "-modulesourcepath", SRC_DIR.toString()));
+            assertTrue(CompilerUtils.compile(msrc, MODS_DIR, "--module-source-path", SRC_DIR.toString()));
         }
 
         if (Files.exists(IMAGE)) {
@@ -87,8 +87,8 @@
         Path jlink = Paths.get(JAVA_HOME, "bin", "jlink");
         String mp = JMODS.toString() + File.pathSeparator + MODS_DIR.toString();
         assertTrue(executeProcess(jlink.toString(), "--output", outputDir.toString(),
-                        "--addmods", Arrays.stream(modules).collect(Collectors.joining(",")),
-                        "--modulepath", mp)
+                        "--add-modules", Arrays.stream(modules).collect(Collectors.joining(",")),
+                        "--module-path", mp)
                         .outputTo(System.out)
                         .errorTo(System.out)
                         .getExitValue() == 0);
--- a/jdk/test/tools/jmod/JmodNegativeTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/tools/jmod/JmodNegativeTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -314,7 +314,7 @@
         jmod("create",
              "--class-path", cp,
              "--hash-modules", ".*",
-             "--modulepath", emptyDir.toString(),
+             "--module-path", emptyDir.toString(),
             jmod.toString())
             .resultChecker(r ->
                 assertContains(r.output, "No hashes recorded: " +
@@ -335,7 +335,7 @@
             jmod("create",
                  "--class-path", cp,
                  "--hash-modules", ".*",
-                 "--modulepath", MODS_DIR.toString(),
+                 "--module-path", MODS_DIR.toString(),
                  jmod.toString())
                 .assertFailure();
         } finally {
@@ -353,7 +353,7 @@
 
         jmod("create",
              "--hash-modules", ".*",
-             "--modulepath", file.toString(),
+             "--module-path", file.toString(),
              jmod.toString())
             .assertFailure()
             .resultChecker(r ->
@@ -370,7 +370,7 @@
         List<Supplier<JmodResult>> tasks = Arrays.asList(
                 () -> jmod("create",
                            "--hash-modules", "anyPattern",
-                           "--modulepath", "doesNotExist",
+                           "--module-path", "doesNotExist",
                            "output.jmod"),
                 () -> jmod("create",
                            "--class-path", "doesNotExist",
@@ -418,7 +418,7 @@
         List<Supplier<JmodResult>> tasks = Arrays.asList(
             () -> jmod("create",
                        "--hash-modules", "anyPattern",
-                       "--modulepath","empty" + pathSeparator + "doesNotExist",
+                       "--module-path","empty" + pathSeparator + "doesNotExist",
                        "output.jmod"),
             () -> jmod("create",
                        "--class-path", "empty" + pathSeparator + "doesNotExist",
@@ -467,7 +467,7 @@
                            "--class-path", "aFile.txt",
                            "output.jmod"),
                 () -> jmod("create",
-                           "--modulepath", "aFile.txt",
+                           "--module-path", "aFile.txt",
                            "output.jmod"),
                 () -> jmod("create",
                            "--cmds", "aFile.txt",
--- a/jdk/test/tools/jmod/hashes/HashesTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/tools/jmod/hashes/HashesTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -1,5 +1,5 @@
 /**
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -88,7 +88,7 @@
         // build m1
         compileModule("m1", modSrc);
         // no hash is recorded since m1 has outgoing edges
-        jmod("m1", "--modulepath", jmods.toString(), "--hash-modules", ".*");
+        jmod("m1", "--module-path", jmods.toString(), "--hash-modules", ".*");
 
         // compile org.bar and org.foo
         compileModule("org.bar", modSrc);
@@ -109,17 +109,17 @@
         }
 
         // hash m1 in m2
-        jmod("m2", "--modulepath", jmods.toString(), "--hash-modules", "m1");
+        jmod("m2", "--module-path", jmods.toString(), "--hash-modules", "m1");
         checkHashes(hashes("m2").get(), "m1");
 
         // hash m1 in m2
-        jmod("m2", "--modulepath", jmods.toString(), "--hash-modules", ".*");
+        jmod("m2", "--module-path", jmods.toString(), "--hash-modules", ".*");
         checkHashes(hashes("m2").get(), "m1");
 
         // create m2.jmod with no hash
         jmod("m2");
         // run jmod hash command to hash m1 in m2 and m3
-        runJmod(Arrays.asList("hash", "--modulepath", jmods.toString(),
+        runJmod(Arrays.asList("hash", "--module-path", jmods.toString(),
                 "--hash-modules", ".*"));
         checkHashes(hashes("m2").get(), "m1");
         checkHashes(hashes("m3").get(), "m1");
@@ -127,10 +127,10 @@
         jmod("org.bar");
         jmod("org.foo");
 
-        jmod("org.bar", "--modulepath", jmods.toString(), "--hash-modules", "org.*");
+        jmod("org.bar", "--module-path", jmods.toString(), "--hash-modules", "org.*");
         checkHashes(hashes("org.bar").get(), "org.foo");
 
-        jmod("m3", "--modulepath", jmods.toString(), "--hash-modules", ".*");
+        jmod("m3", "--module-path", jmods.toString(), "--hash-modules", ".*");
         checkHashes(hashes("m3").get(), "org.foo", "org.bar", "m1");
     }
 
@@ -185,7 +185,7 @@
 
     private void compileModule(String moduleName, Path src) throws IOException {
         Path msrc = src.resolve(moduleName);
-        assertTrue(CompilerUtils.compile(msrc, mods, "-modulesourcepath", src.toString()));
+        assertTrue(CompilerUtils.compile(msrc, mods, "--module-source-path", src.toString()));
     }
 
     private void jmod(String moduleName, String... options) throws IOException {
--- a/jdk/test/tools/launcher/MiscTests.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/tools/launcher/MiscTests.java	Wed Aug 10 15:51:25 2016 -0700
@@ -70,7 +70,7 @@
 
         final String mainClass = "Foo6856415";
         final String exportOpts
-            = "-XaddExports:jdk.crypto.pkcs11/sun.security.pkcs11=ALL-UNNAMED";
+            = "--add-exports=jdk.crypto.pkcs11/sun.security.pkcs11=ALL-UNNAMED";
 
         List<String> scratch = new ArrayList<>();
         scratch.add("public class Foo6856415 {");
--- a/jdk/test/tools/launcher/ToolsOpts.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/tools/launcher/ToolsOpts.java	Wed Aug 10 15:51:25 2016 -0700
@@ -151,7 +151,7 @@
         init();
         TestResult tr;
         int jpos = -1;
-        String xPatch = "-J-Xpatch:jdk.compiler=jdk.compiler";
+        String xPatch = "-J--patch-module=jdk.compiler=jdk.compiler";
         for (String arg[] : optionPatterns) {
             jpos = indexOfJoption(arg);
             //Build a cmd string for output in results reporting.
--- a/jdk/test/tools/launcher/modules/addexports/AddExportsTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/tools/launcher/modules/addexports/AddExportsTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -27,7 +27,7 @@
  * @modules jdk.compiler
  * @build AddExportsTest CompilerUtils jdk.testlibrary.*
  * @run testng AddExportsTest
- * @summary Basic tests for java -XaddExports
+ * @summary Basic tests for java --add-exports
  */
 
 import java.nio.file.Path;
@@ -71,7 +71,7 @@
         boolean compiled = CompilerUtils.compile(
                 SRC_DIR.resolve(TEST1_MODULE),
                 MODS_DIR.resolve(TEST1_MODULE),
-                "-XaddExports:java.base/jdk.internal.misc=m1");
+                "--add-exports", "java.base/jdk.internal.misc=m1");
         assertTrue(compiled, "module " + TEST1_MODULE + " did not compile");
 
         // javac -d upgrademods/java.transaction src/java.transaction/**
@@ -80,12 +80,12 @@
                 UPGRADE_MODS_DIRS.resolve("java.transaction"));
         assertTrue(compiled, "module java.transaction did not compile");
 
-        // javac -upgrademodulepath upgrademods -d mods/m2 src/m2/**
+        // javac --upgrade-module-path upgrademods -d mods/m2 src/m2/**
         compiled = CompilerUtils.compile(
                 SRC_DIR.resolve(TEST2_MODULE),
                 MODS_DIR.resolve(TEST2_MODULE),
-                "-upgrademodulepath", UPGRADE_MODS_DIRS.toString(),
-                "-XaddExports:java.transaction/javax.transaction.internal=m2");
+                "--upgrade-module-path", UPGRADE_MODS_DIRS.toString(),
+                "--add-exports", "java.transaction/javax.transaction.internal=m2");
         assertTrue(compiled, "module " + TEST2_MODULE + " did not compile");
 
         // javac -d mods/m3 src/m3/**
@@ -107,7 +107,7 @@
     public void testSanity() throws Exception {
 
         int exitValue
-            =  executeTestJava("-XaddExports:java.base/jdk.internal.reflect=ALL-UNNAMED",
+            =  executeTestJava("--add-exports", "java.base/jdk.internal.reflect=ALL-UNNAMED",
                                "-version")
                 .outputTo(System.out)
                 .errorTo(System.out)
@@ -122,12 +122,12 @@
      */
     public void testUnnamedModule() throws Exception {
 
-        // java -XaddExports:java.base/jdk.internal.misc=ALL-UNNAMED \
+        // java --add-exports java.base/jdk.internal.misc=ALL-UNNAMED \
         //      -cp mods/$TESTMODULE jdk.test.UsesUnsafe
 
         String classpath = MODS_DIR.resolve(TEST1_MODULE).toString();
         int exitValue
-            = executeTestJava("-XaddExports:java.base/jdk.internal.misc=ALL-UNNAMED",
+            = executeTestJava("--add-exports", "java.base/jdk.internal.misc=ALL-UNNAMED",
                               "-cp", classpath,
                               TEST1_MAIN_CLASS)
                 .outputTo(System.out)
@@ -143,13 +143,13 @@
      */
     public void testNamedModule() throws Exception {
 
-        //  java -XaddExports:java.base/jdk.internal.misc=test \
-        //       -mp mods -m $TESTMODULE/$MAIN_CLASS
+        //  java --add-exports java.base/jdk.internal.misc=test \
+        //       --module-path mods -m $TESTMODULE/$MAIN_CLASS
 
         String mid = TEST1_MODULE + "/" + TEST1_MAIN_CLASS;
         int exitValue =
-            executeTestJava("-XaddExports:java.base/jdk.internal.misc=" + TEST1_MODULE,
-                            "-mp", MODS_DIR.toString(),
+            executeTestJava("--add-exports", "java.base/jdk.internal.misc=" + TEST1_MODULE,
+                            "--module-path", MODS_DIR.toString(),
                             "-m", mid)
                 .outputTo(System.out)
                 .errorTo(System.out)
@@ -160,17 +160,17 @@
 
 
     /**
-     * Test -XaddExports with upgraded module
+     * Test --add-exports with upgraded module
      */
     public void testWithUpgradedModule() throws Exception {
 
-        // java -XaddExports:java.transaction/javax.transaction.internal=m2
-        //      -upgrademodulepath upgrademods -mp mods -m ...
+        // java --add-exports java.transaction/javax.transaction.internal=m2
+        //      --upgrade-module-path upgrademods --module-path mods -m ...
         String mid = TEST2_MODULE + "/" + TEST2_MAIN_CLASS;
         int exitValue = executeTestJava(
-                "-XaddExports:java.transaction/javax.transaction.internal=m2",
-                "-upgrademodulepath", UPGRADE_MODS_DIRS.toString(),
-                "-mp", MODS_DIR.toString(),
+                "--add-exports", "java.transaction/javax.transaction.internal=m2",
+                "--upgrade-module-path", UPGRADE_MODS_DIRS.toString(),
+                "--module-path", MODS_DIR.toString(),
                 "-m", mid)
                 .outputTo(System.out)
                 .errorTo(System.out)
@@ -181,17 +181,17 @@
 
 
     /**
-     * Test -XaddExports with module that is added to the set of root modules
-     * with -addmods.
+     * Test --add-exports with module that is added to the set of root modules
+     * with --add-modules.
      */
     public void testWithAddMods() throws Exception {
 
-        // java -XaddExports:m4/jdk.test4=m3 -mp mods -m ...
+        // java --add-exports m4/jdk.test4=m3 --module-path mods -m ...
         String mid = TEST3_MODULE + "/" + TEST3_MAIN_CLASS;
         int exitValue = executeTestJava(
-                "-XaddExports:m4/jdk.test4=m3",
-                "-mp", MODS_DIR.toString(),
-                "-addmods", TEST4_MODULE,
+                "--add-exports", "m4/jdk.test4=m3",
+                "--module-path", MODS_DIR.toString(),
+                "--add-modules", TEST4_MODULE,
                 "-m", mid)
                 .outputTo(System.out)
                 .errorTo(System.out)
@@ -202,13 +202,13 @@
 
 
     /**
-     * -XaddExports can only be specified once
+     * --add-exports can only be specified once
      */
     public void testWithDuplicateOption() throws Exception {
 
         int exitValue
-            =  executeTestJava("-XaddExports:java.base/jdk.internal.reflect=ALL-UNNAMED",
-                               "-XaddExports:java.base/jdk.internal.reflect=ALL-UNNAMED",
+            =  executeTestJava("--add-exports", "java.base/jdk.internal.reflect=ALL-UNNAMED",
+                               "--add-exports", "java.base/jdk.internal.reflect=ALL-UNNAMED",
                                "-version")
                 .outputTo(System.out)
                 .errorTo(System.out)
@@ -220,14 +220,14 @@
 
 
     /**
-     * Exercise -XaddExports with bad values
+     * Exercise --add-exports with bad values
      */
     @Test(dataProvider = "badvalues")
     public void testWithBadValue(String value, String ignore) throws Exception {
 
-        //  -XaddExports:$VALUE -version
+        //  --add-exports $VALUE -version
         int exitValue =
-            executeTestJava("-XaddExports:" + value,
+            executeTestJava("--add-exports", value,
                             "-version")
                 .outputTo(System.out)
                 .errorTo(System.out)
--- a/jdk/test/tools/launcher/modules/addmods/AddModsTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/tools/launcher/modules/addmods/AddModsTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -28,7 +28,7 @@
  *          jdk.compiler
  * @build AddModsTest CompilerUtils jdk.testlibrary.*
  * @run testng AddModsTest
- * @summary Basic test for java -addmods
+ * @summary Basic test for java --add-modules
  */
 
 import java.nio.file.Path;
@@ -78,15 +78,15 @@
 
 
     /**
-     * Basic test of -addmods ALL-DEFAULT. Module java.sql should be
+     * Basic test of --add-modules ALL-DEFAULT. Module java.sql should be
      * resolved and the types in that module should be visible.
      */
     public void testAddDefaultModules1() throws Exception {
 
-        // java -addmods ALL-DEFAULT -mp mods1 -m test ...
+        // java --add-modules ALL-DEFAULT --module-path mods1 -m test ...
         int exitValue
-            = executeTestJava("-mp", MODS1_DIR.toString(),
-                              "-addmods", "ALL-DEFAULT",
+            = executeTestJava("--module-path", MODS1_DIR.toString(),
+                              "--add-modules", "ALL-DEFAULT",
                               "-m", TEST_MID,
                               "java.sql.Connection")
                 .outputTo(System.out)
@@ -97,16 +97,16 @@
     }
 
     /**
-     * Basic test of -addmods ALL-DEFAULT. Module java.annotations.common
+     * Basic test of --add-modules ALL-DEFAULT. Module java.annotations.common
      * should not resolved and so the types in that module should not be
      * visible.
      */
     public void testAddDefaultModules2() throws Exception {
 
-        // java -addmods ALL-DEFAULT -mp mods1 -m test ...
+        // java --add-modules ALL-DEFAULT --module-path mods1 -m test ...
         int exitValue
-            = executeTestJava("-mp", MODS1_DIR.toString(),
-                              "-addmods", "ALL-DEFAULT",
+            = executeTestJava("--module-path", MODS1_DIR.toString(),
+                              "--add-modules", "ALL-DEFAULT",
                               "-m", TEST_MID,
                               "javax.annotation.Generated")
                 .outputTo(System.out)
@@ -118,15 +118,15 @@
     }
 
     /**
-     * Basic test of -addmods ALL-SYSTEM. All system modules should be resolved
+     * Basic test of --add-modules ALL-SYSTEM. All system modules should be resolved
      * and thus all types in those modules should be visible.
      */
     public void testAddSystemModules() throws Exception {
 
-        // java -addmods ALL-SYSTEM -mp mods1 -m test ...
+        // java --add-modules ALL-SYSTEM --module-path mods1 -m test ...
         int exitValue
-            = executeTestJava("-mp", MODS1_DIR.toString(),
-                              "-addmods", "ALL-SYSTEM",
+            = executeTestJava("--module-path", MODS1_DIR.toString(),
+                              "--add-modules", "ALL-SYSTEM",
                               "-m", TEST_MID,
                               "java.sql.Connection",
                               "javax.annotation.Generated")
@@ -140,16 +140,16 @@
 
     /**
      * Run test on class path to load a type in a module on the application
-     * module path, uses {@code -addmods logger}.
+     * module path, uses {@code --add-modules logger}.
      */
     public void testRunWithAddMods() throws Exception {
 
-        // java -mp mods -addmods logger -cp classes test.Main
+        // java --module-path mods --add-modules logger -cp classes test.Main
         String classpath = MODS1_DIR.resolve(TEST_MODULE).toString();
         String modulepath = MODS2_DIR.toString();
         int exitValue
-            = executeTestJava("-mp", modulepath,
-                              "-addmods", LOGGER_MODULE,
+            = executeTestJava("--module-path", modulepath,
+                              "--add-modules", LOGGER_MODULE,
                               "-cp", classpath,
                               TEST_MAIN_CLASS,
                               "logger.Logger")
@@ -162,16 +162,16 @@
 
      /**
       * Run application on class path that makes use of module on the
-      * application module path. Does not use -addmods and so should
+      * application module path. Does not use --add-modules and so should
       * fail at run-time.
       */
      public void testRunMissingAddMods() throws Exception {
 
-         // java -mp mods -cp classes test.Main
+         // java --module-path mods -cp classes test.Main
          String classpath = MODS1_DIR.resolve(TEST_MODULE).toString();
          String modulepath = MODS1_DIR.toString();
          int exitValue
-             = executeTestJava("-mp", modulepath,
+             = executeTestJava("--module-path", modulepath,
                                "-cp", classpath,
                                TEST_MAIN_CLASS,
                                "logger.Logger")
@@ -186,16 +186,16 @@
 
     /**
      * Run test on class path to load a type in a module on the application
-     * module path, uses {@code -addmods ALL-MODULE-PATH}.
+     * module path, uses {@code --add-modules ALL-MODULE-PATH}.
      */
     public void testAddAllModulePath() throws Exception {
 
-        // java -mp mods -addmods ALL-MODULE-PATH -cp classes test.Main
+        // java --module-path mods --add-modules ALL-MODULE-PATH -cp classes test.Main
         String classpath = MODS1_DIR.resolve(TEST_MODULE).toString();
         String modulepath = MODS1_DIR.toString();
         int exitValue
-            = executeTestJava("-mp", modulepath,
-                              "-addmods", "ALL-MODULE-PATH",
+            = executeTestJava("--module-path", modulepath,
+                              "--add-modules", "ALL-MODULE-PATH",
                               "-cp", classpath,
                               TEST_MAIN_CLASS)
                 .outputTo(System.out)
@@ -207,13 +207,13 @@
 
 
     /**
-     * Test {@code -addmods ALL-MODULE-PATH} without {@code -modulepath}.
+     * Test {@code --add-modules ALL-MODULE-PATH} without {@code --module-path}.
      */
     public void testAddAllModulePathWithNoModulePath() throws Exception {
 
-        // java -addmods ALL-MODULE-PATH -version
+        // java --add-modules ALL-MODULE-PATH -version
         int exitValue
-            = executeTestJava("-addmods", "ALL-MODULE-PATH",
+            = executeTestJava("--add-modules", "ALL-MODULE-PATH",
                               "-version")
                 .outputTo(System.out)
                 .errorTo(System.out)
@@ -224,14 +224,14 @@
 
 
     /**
-     * Attempt to run with a bad module name specified to -addmods
+     * Attempt to run with a bad module name specified to --add-modules
      */
     public void testRunWithBadAddMods() throws Exception {
 
-        // java -mp mods -addmods DoesNotExist -m test ...
+        // java --module-path mods --add-modules DoesNotExist -m test ...
         int exitValue
-            = executeTestJava("-mp", MODS1_DIR.toString(),
-                              "-addmods", "DoesNotExist",
+            = executeTestJava("--module-path", MODS1_DIR.toString(),
+                              "--add-modules", "DoesNotExist",
                               "-m", TEST_MID)
                 .outputTo(System.out)
                 .errorTo(System.out)
--- a/jdk/test/tools/launcher/modules/addmods/src/logger/logger/Logger.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/tools/launcher/modules/addmods/src/logger/logger/Logger.java	Wed Aug 10 15:51:25 2016 -0700
@@ -24,7 +24,7 @@
 package logger;
 
 /**
- * No-op user module for use by the {@code java -addmods} tests.
+ * No-op user module for use by the {@code java --add-modules} tests.
  */
 public class Logger {
 }
--- a/jdk/test/tools/launcher/modules/addmods/src/test/test/Main.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/tools/launcher/modules/addmods/src/test/test/Main.java	Wed Aug 10 15:51:25 2016 -0700
@@ -24,7 +24,7 @@
 package test;
 
 /**
- * Invoked by tests for the {@code java -addmods} option to check that types
+ * Invoked by tests for the {@code java --add-modules} option to check that types
  * are visible.
  */
 public class Main {
--- a/jdk/test/tools/launcher/modules/addreads/AddReadsTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/tools/launcher/modules/addreads/AddReadsTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -27,7 +27,7 @@
  * @modules jdk.compiler
  * @build AddReadsTest CompilerUtils JarUtils jdk.testlibrary.*
  * @run testng AddReadsTest
- * @summary Basic tests for java -XaddReads
+ * @summary Basic tests for java --add-reads
  */
 
 import java.nio.file.Path;
@@ -45,7 +45,7 @@
  * The tests consists of two modules: m1 and junit.
  * Code in module m1 calls into code in module junit but the module-info.java
  * does not have a 'requires'. Instead a read edge is added via the command
- * line option -XaddReads.
+ * line option --add-reads.
  */
 
 @Test
@@ -72,7 +72,7 @@
             .compile(SRC_DIR.resolve("m1"),
                     MODS_DIR.resolve("m1"),
                     "-cp", CLASSES_DIR.toString(),
-                    "-XaddReads:m1=ALL-UNNAMED"));
+                    "--add-reads", "m1=ALL-UNNAMED"));
 
         // jar cf mods/junit.jar -C classes .
         JarUtils.createJarFile(MODS_DIR.resolve("junit.jar"), CLASSES_DIR);
@@ -91,11 +91,11 @@
      */
     public void testJUnitOnModulePath() throws Exception {
 
-        // java -mp mods -addmods junit -XaddReads:m1=junit -m ..
+        // java --module-path mods --add-modules junit --add-reads m1=junit -m ..
         int exitValue
-            = run("-mp", MODS_DIR.toString(),
-                  "-addmods", "junit",
-                  "-XaddReads:m1=junit",
+            = run("--module-path", MODS_DIR.toString(),
+                  "--add-modules", "junit",
+                  "--add-reads", "m1=junit",
                   "-m", MAIN)
                 .getExitValue();
 
@@ -104,17 +104,17 @@
 
 
     /**
-     * Exercise -XaddReads:m1=ALL-UNNAMED by running with junit on the
+     * Exercise --add-reads m1=ALL-UNNAMED by running with junit on the
      * class path.
      */
     public void testJUnitOnClassPath() throws Exception {
 
-        // java -mp mods -cp mods/junit.jar -XaddReads:m1=ALL-UNNAMED -m ..
+        // java --module-path mods -cp mods/junit.jar --add-reads m1=ALL-UNNAMED -m ..
         String cp = MODS_DIR.resolve("junit.jar").toString();
         int exitValue
-            = run("-mp", MODS_DIR.toString(),
+            = run("--module-path", MODS_DIR.toString(),
                   "-cp", cp,
-                  "-XaddReads:m1=ALL-UNNAMED",
+                  "--add-reads", "m1=ALL-UNNAMED",
                   "-m", MAIN)
                 .getExitValue();
 
@@ -123,14 +123,14 @@
 
 
     /**
-     * Run with junit as a module on the module path but without -XaddReads.
+     * Run with junit as a module on the module path but without --add-reads.
      */
     public void testJUnitOnModulePathMissingAddReads() throws Exception {
-        // java -mp mods -addmods junit -m ..
+        // java --module-path mods --add-modules junit --module ..
         int exitValue
-            = run("-mp", MODS_DIR.toString(),
-                  "-addmods", "junit",
-                  "-m", MAIN)
+            = run("--module-path", MODS_DIR.toString(),
+                  "--add-modules", "junit",
+                  "--module", MAIN)
                 .shouldContain("IllegalAccessError")
                 .getExitValue();
 
@@ -139,13 +139,13 @@
 
 
     /**
-     * Run with junit on the class path but without -XaddReads.
+     * Run with junit on the class path but without --add-reads.
      */
     public void testJUnitOnClassPathMissingAddReads() throws Exception {
-        // java -mp mods -cp mods/junit.jar -m ..
+        // java --module-path mods -cp mods/junit.jar -m ..
         String cp = MODS_DIR.resolve("junit.jar").toString();
         int exitValue
-            = run("-mp", MODS_DIR.toString(),
+            = run("--module-path", MODS_DIR.toString(),
                   "-cp", cp,
                   "-m", MAIN)
                 .shouldContain("IllegalAccessError")
@@ -156,15 +156,15 @@
 
 
     /**
-     * Exercise -XaddReads with a more than one source module.
+     * Exercise --add-reads with a more than one source module.
      */
     public void testJUnitWithMultiValueOption() throws Exception {
 
         int exitValue
-            = run("-mp", MODS_DIR.toString(),
-                  "-addmods", "java.xml,junit",
-                  "-XaddReads:m1=java.xml,junit",
-                  "-m", MAIN)
+            = run("--module-path", MODS_DIR.toString(),
+                  "--add-modules", "java.xml,junit",
+                  "--add-reads", "m1=java.xml,junit",
+                  "--module", MAIN)
                 .getExitValue();
 
         assertTrue(exitValue == 0);
@@ -172,31 +172,31 @@
 
 
     /**
-     * Exercise -XaddReads where the target module is specified more than once
+     * Exercise --add-reads where the target module is specified more than once
      */
     public void testWithTargetSpecifiedManyTimes() throws Exception {
 
         int exitValue
-            = run("-mp", MODS_DIR.toString(),
-                "-addmods", "java.xml,junit",
-                "-XaddReads:m1=java.xml",
-                "-XaddReads:m1=junit",
-                "-m", MAIN)
-                .shouldContain("specified more than once")
-                .getExitValue();
+            = run("--module-path", MODS_DIR.toString(),
+                  "--add-modules", "java.xml,junit",
+                  "--add-reads", "m1=java.xml",
+                  "--add-reads", "m1=junit",
+                  "-m", MAIN)
+                  .shouldContain("specified more than once")
+                 .getExitValue();
 
         assertTrue(exitValue != 0);
     }
 
 
     /**
-     * Exercise -XaddReads with bad values
+     * Exercise --add-reads with bad values
      */
     @Test(dataProvider = "badvalues")
     public void testWithBadValue(String value, String ignore) throws Exception {
 
-        //  -XaddExports:$VALUE -version
-        assertTrue(run("-XaddReads:" + value, "-version").getExitValue() != 0);
+        //  --add-exports $VALUE -version
+        assertTrue(run("--add-reads", value, "-version").getExitValue() != 0);
     }
 
     @DataProvider(name = "badvalues")
--- a/jdk/test/tools/launcher/modules/basic/BasicTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/tools/launcher/modules/basic/BasicTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -37,7 +37,7 @@
 import java.nio.file.Path;
 import java.nio.file.Paths;
 
-import static jdk.testlibrary.ProcessTools.*;
+import jdk.testlibrary.ProcessTools;
 
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.Test;
@@ -72,6 +72,16 @@
         assertTrue(compiled, "test module did not compile");
     }
 
+    /**
+     * Execute "java" with the given arguments, returning the exit code.
+     */
+    private int exec(String... args) throws Exception {
+       return ProcessTools.executeTestJava(args)
+                .outputTo(System.out)
+                .errorTo(System.out)
+                .getExitValue();
+    }
+
 
     /**
      * The initial module is loaded from an exploded module
@@ -81,20 +91,28 @@
         String subdir = MODS_DIR.resolve(TEST_MODULE).toString();
         String mid = TEST_MODULE + "/" + MAIN_CLASS;
 
-        // java -mp mods -m $TESTMODULE/$MAINCLASS
-        int exitValue
-            = executeTestJava("-mp", dir, "-m", mid)
-                .outputTo(System.out)
-                .errorTo(System.out)
-                .getExitValue();
+        // java --module-path mods -module $TESTMODULE/$MAINCLASS
+        int exitValue = exec("--module-path", dir, "--module", mid);
+        assertTrue(exitValue == 0);
+
+        // java --module-path mods/$TESTMODULE --module $TESTMODULE/$MAINCLASS
+        exitValue = exec("--module-path", subdir, "--module", mid);
         assertTrue(exitValue == 0);
 
-        // java -mp mods/$TESTMODULE -m $TESTMODULE/$MAINCLASS
-        exitValue
-            = executeTestJava("-mp", subdir, "-m", mid)
-                .outputTo(System.out)
-                .errorTo(System.out)
-                .getExitValue();
+        // java --module-path=mods --module=$TESTMODULE/$MAINCLASS
+        exitValue = exec("--module-path=" + dir, "--module=" + mid);
+        assertTrue(exitValue == 0);
+
+        // java --module-path=mods/$TESTMODULE --module=$TESTMODULE/$MAINCLASS
+        exitValue = exec("--module-path=" + subdir, "--module=" + mid);
+        assertTrue(exitValue == 0);
+
+        // java -p mods -m $TESTMODULE/$MAINCLASS
+        exitValue = exec("-p", dir, "-m", mid);
+        assertTrue(exitValue == 0);
+
+        // java -p mods/$TESTMODULE -m $TESTMODULE/$MAINCLASS
+        exitValue = exec("-p", subdir, "-m", mid);
         assertTrue(exitValue == 0);
     }
 
@@ -119,22 +137,14 @@
                 .run(args);
         assertTrue(success);
 
-        // java -mp mlib -m $TESTMODULE
-        int exitValue
-            = executeTestJava("-mp", dir.toString(),
-                              "-m", TEST_MODULE)
-                .outputTo(System.out)
-                .errorTo(System.out)
-                .getExitValue();
+        // java --module-path mlib -module $TESTMODULE
+        int exitValue = exec("--module-path", dir.toString(),
+                             "--module", TEST_MODULE);
         assertTrue(exitValue == 0);
 
-        // java -mp mlib/m.jar -m $TESTMODULE
-        exitValue
-            = executeTestJava("-mp", jar.toString(),
-                              "-m", TEST_MODULE)
-                .outputTo(System.out)
-                .errorTo(System.out)
-                .getExitValue();
+        // java --module-path mlib/m.jar -module $TESTMODULE
+        exitValue = exec("--module-path", jar.toString(),
+                         "--module", TEST_MODULE);
         assertTrue(exitValue == 0);
     }
 
@@ -157,14 +167,9 @@
         jdk.tools.jmod.JmodTask task = new jdk.tools.jmod.JmodTask();
         assertEquals(task.run(args), 0);
 
-        // java -mp mods -m $TESTMODULE
-        int exitValue
-            = executeTestJava("-mp", dir.toString(),
-                "-m", TEST_MODULE)
-                .outputTo(System.out)
-                .errorTo(System.out)
-                .getExitValue();
-
+        // java --module-path mods --module $TESTMODULE
+        int exitValue = exec("--module-path", dir.toString(),
+                             "--module", TEST_MODULE);
         assertTrue(exitValue != 0);
     }
 
@@ -177,14 +182,8 @@
         String mp = "DoesNotExist" + File.pathSeparator + MODS_DIR.toString();
         String mid = TEST_MODULE + "/" + MAIN_CLASS;
 
-        // java -mp mods -m $TESTMODULE/$MAINCLASS
-        int exitValue
-            = executeTestJava("-mp", mp,
-                              "-m", mid)
-                .outputTo(System.out)
-                .errorTo(System.out)
-                .getExitValue();
-
+        // java --module-path mods --module $TESTMODULE/$MAINCLASS
+        int exitValue = exec("--module-path", mp, "--module", mid);
         assertTrue(exitValue == 0);
     }
 
@@ -195,15 +194,8 @@
     public void testTryRunWithBadModule() throws Exception {
         String modulepath = MODS_DIR.toString();
 
-        // java -mp mods -m $TESTMODULE
-        int exitValue
-            = executeTestJava("-mp", modulepath,
-                              "-m", "rhubarb")
-                .outputTo(System.out)
-                .errorTo(System.out)
-                .shouldContain("not found")
-                .getExitValue();
-
+        // java --module-path mods -m $TESTMODULE
+        int exitValue = exec("--module-path", modulepath, "-m", "rhubarb");
         assertTrue(exitValue != 0);
     }
 
@@ -216,14 +208,8 @@
         String modulepath = MODS_DIR.toString();
         String mid = TEST_MODULE + "/p.rhubarb";
 
-        // java -mp mods -m $TESTMODULE/$MAINCLASS
-        int exitValue
-            = executeTestJava("-mp", modulepath,
-                              "-m", mid)
-                .outputTo(System.out)
-                .errorTo(System.out)
-                .getExitValue();
-
+        // java --module-path mods -m $TESTMODULE/$MAINCLASS
+        int exitValue = exec("--module-path", modulepath, "-m", mid);
         assertTrue(exitValue != 0);
     }
 
@@ -248,15 +234,8 @@
                 .run(args);
         assertTrue(success);
 
-        // java -mp mods -m $TESTMODULE
-        int exitValue
-            = executeTestJava("-mp", dir.toString(),
-                              "-m", TEST_MODULE)
-                .outputTo(System.out)
-                .errorTo(System.out)
-                .shouldContain("does not have a MainClass attribute")
-                .getExitValue();
-
+        // java --module-path mods -m $TESTMODULE
+        int exitValue = exec("--module-path", dir.toString(), "-m", TEST_MODULE);
         assertTrue(exitValue != 0);
     }
 
@@ -269,14 +248,8 @@
         String modulepath = MODS_DIR.toString();
         String mid = "java.base/" + MAIN_CLASS;
 
-        // java -mp mods -m $TESTMODULE/$MAINCLASS
-        int exitValue
-            = executeTestJava("-mp", modulepath,
-                              "-m", mid)
-                .outputTo(System.out)
-                .errorTo(System.out)
-                .getExitValue();
-
+        // java --module-path mods --module $TESTMODULE/$MAINCLASS
+        int exitValue = exec("--module-path", modulepath, "--module", mid);
         assertTrue(exitValue != 0);
     }
 
--- a/jdk/test/tools/launcher/modules/dryrun/DryRunTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/tools/launcher/modules/dryrun/DryRunTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -69,11 +69,11 @@
         // javac -d mods/$TESTMODULE src/$TESTMODULE/**
         assertTrue(CompilerUtils.compile(SRC_DIR.resolve(M_MODULE),
                                          MODS_DIR,
-                                         "-modulesourcepath", SRC_DIR.toString()));
+                                         "--module-source-path", SRC_DIR.toString()));
 
         assertTrue(CompilerUtils.compile(SRC_DIR.resolve(TEST_MODULE),
                                          MODS_DIR,
-                                         "-modulesourcepath", SRC_DIR.toString()));
+                                         "--module-source-path", SRC_DIR.toString()));
 
         Files.createDirectories(LIBS_DIR);
 
@@ -101,7 +101,7 @@
         String mid = TEST_MODULE + "/" + MAIN_CLASS;
 
         // no resolution failure
-        int exitValue = exec("--dry-run", "-modulepath", dir, "-m", mid);
+        int exitValue = exec("--dry-run", "--module-path", dir, "-m", mid);
         assertTrue(exitValue == 0);
     }
 
@@ -112,23 +112,23 @@
         String dir = MODS_DIR.toString();
         String mid = TEST_MODULE + "/" + MAIN_CLINIT_CLASS;
 
-        int exitValue = exec("--dry-run", "-modulepath", dir, "-m", mid);
+        int exitValue = exec("--dry-run", "--module-path", dir, "-m", mid);
         assertTrue(exitValue == 0);
 
         // expect the test to fail if main class is initialized
-        exitValue = exec("-modulepath", dir, "-m", mid);
+        exitValue = exec("--module-path", dir, "-m", mid);
         assertTrue(exitValue != 0);
     }
 
     /**
-     * Test non-existence module in -addmods
+     * Test non-existence module in --add-modules
      */
     public void testNonExistAddModules() throws Exception {
         String dir = MODS_DIR.toString();
         String mid = TEST_MODULE + "/" + MAIN_CLASS;
 
-        int exitValue = exec("--dry-run", "-modulepath", dir,
-                             "-addmods", "non.existence",
+        int exitValue = exec("--dry-run", "--module-path", dir,
+                             "--add-modules", "non.existence",
                              "-m", mid);
         assertTrue(exitValue != 0);
     }
@@ -163,24 +163,24 @@
                         LIBS_DIR.resolve(TEST_MODULE + ".jar").toString();
         String mid = TEST_MODULE + "/" + MAIN_CLASS;
 
-        // test main method with and without -addmods mm
-        int exitValue = exec("-modulepath", LIBS_DIR.toString(),
+        // test main method with and without --add-modules mm
+        int exitValue = exec("--module-path", LIBS_DIR.toString(),
                              "-m", mid);
         assertTrue(exitValue != 0);
 
-        exitValue = exec("-modulepath", LIBS_DIR.toString(),
-                         "-addmods", M_MODULE,
+        exitValue = exec("--module-path", LIBS_DIR.toString(),
+                         "--add-modules", M_MODULE,
                          "-m", mid);
         assertTrue(exitValue == 0);
 
-        // test dry run with and without -addmods m
+        // test dry run with and without --add-modules m
         // no resolution failure
-        exitValue = exec("--dry-run", "-modulepath", LIBS_DIR.toString(),
+        exitValue = exec("--dry-run", "--module-path", LIBS_DIR.toString(),
                          "-m", mid);
         assertTrue(exitValue == 0);
 
-        exitValue = exec("--dry-run", "-modulepath", LIBS_DIR.toString(),
-                         "-addmods", M_MODULE,
+        exitValue = exec("--dry-run", "--module-path", LIBS_DIR.toString(),
+                         "--add-modules", M_MODULE,
                          "-m", mid);
         assertTrue(exitValue == 0);
     }
@@ -193,7 +193,7 @@
         String mid = TEST_MODULE + "/" + MAIN_CLASS;
 
         // resolution failure
-        int exitValue = exec("--dry-run", "-modulepath", subdir, "-m", mid);
+        int exitValue = exec("--dry-run", "--module-path", subdir, "-m", mid);
         assertTrue(exitValue != 0);
     }
 
--- a/jdk/test/tools/launcher/modules/limitmods/LimitModsTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/tools/launcher/modules/limitmods/LimitModsTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -27,7 +27,7 @@
  * @modules java.desktop java.compact1 jdk.compiler
  * @build LimitModsTest CompilerUtils jdk.testlibrary.*
  * @run testng LimitModsTest
- * @summary Basic tests for java -limitmods
+ * @summary Basic tests for java --limit-modules
  */
 
 import java.nio.file.Path;
@@ -66,13 +66,13 @@
 
 
     /**
-     * Basic test of -limitmods to limit which platform modules are observable.
+     * Basic test of --limit-modules to limit which platform modules are observable.
      */
     public void testLimitingPlatformModules() throws Exception {
         int exitValue;
 
-        // java -limitmods java.base -listmods
-        exitValue = executeTestJava("-limitmods", "java.base", "-listmods")
+        // java --limit-modules java.base --list-modules
+        exitValue = executeTestJava("--limit-modules", "java.base", "--list-modules")
             .outputTo(System.out)
             .errorTo(System.out)
             .shouldContain("java.base")
@@ -83,8 +83,8 @@
         assertTrue(exitValue == 0);
 
 
-        // java -limitmods java.compact1 -listmods
-        exitValue = executeTestJava("-limitmods", "java.compact1", "-listmods")
+        // java --limit-modules java.compact1 --list-modules
+        exitValue = executeTestJava("--limit-modules", "java.compact1", "--list-modules")
             .outputTo(System.out)
             .errorTo(System.out)
             .shouldContain("java.base")
@@ -98,15 +98,15 @@
 
 
     /**
-     * Test -limitmods with -addmods
+     * Test --limit-modules with --add-modules
      */
     public void testWithAddMods() throws Exception {
         int exitValue;
 
-        // java -limitmods java.base -addmods java.logging -listmods
-        exitValue = executeTestJava("-limitmods", "java.base",
-                                    "-addmods", "java.logging",
-                                    "-listmods")
+        // java --limit-modules java.base --add-modules java.logging --list-modules
+        exitValue = executeTestJava("--limit-modules", "java.base",
+                                    "--add-modules", "java.logging",
+                                    "--list-modules")
             .outputTo(System.out)
             .errorTo(System.out)
             .shouldContain("java.base")
@@ -117,11 +117,11 @@
         assertTrue(exitValue == 0);
 
 
-        // java -limitmods java.base -addmods java.sql -listmods
+        // java --limit-modules java.base --add-modules java.sql --list-modules
         // This should fail because java.sql has dependences beyond java.base
-        exitValue = executeTestJava("-limitmods", "java.base",
-                                    "-addmods", "java.sql",
-                                    "-listmods")
+        exitValue = executeTestJava("--limit-modules", "java.base",
+                                    "--add-modules", "java.sql",
+                                    "--list-modules")
             .outputTo(System.out)
             .errorTo(System.out)
             .getExitValue();
@@ -131,14 +131,14 @@
 
 
     /**
-     * Run class path application with -limitmods
+     * Run class path application with --limit-modules
      */
     public void testUnnamedModule() throws Exception {
         String classpath = MODS_DIR.resolve(TEST_MODULE).toString();
 
-        // java -limitmods java.base -cp mods/$TESTMODULE ...
+        // java --limit-modules java.base -cp mods/$TESTMODULE ...
         int exitValue1
-            = executeTestJava("-limitmods", "java.base",
+            = executeTestJava("--limit-modules", "java.base",
                               "-cp", classpath,
                               MAIN_CLASS)
                 .outputTo(System.out)
@@ -149,9 +149,9 @@
         assertTrue(exitValue1 != 0);
 
 
-        // java -limitmods java.base -cp mods/$TESTMODULE ...
+        // java --limit-modules java.base -cp mods/$TESTMODULE ...
         int exitValue2
-            = executeTestJava("-limitmods", "java.desktop",
+            = executeTestJava("--limit-modules", "java.desktop",
                               "-cp", classpath,
                              MAIN_CLASS)
                 .outputTo(System.out)
@@ -163,16 +163,16 @@
 
 
     /**
-     * Run named module with -limitmods
+     * Run named module with --limit-modules
      */
     public void testNamedModule() throws Exception {
 
         String modulepath = MODS_DIR.toString();
         String mid = TEST_MODULE + "/" + MAIN_CLASS;
 
-        // java -limitmods java.base -mp mods -m $TESTMODULE/$MAINCLASS
-        int exitValue = executeTestJava("-limitmods", "java.base",
-                                        "-mp", modulepath,
+        // java --limit-modules java.base --module-path mods -m $TESTMODULE/$MAINCLASS
+        int exitValue = executeTestJava("--limit-modules", "java.base",
+                                        "--module-path", modulepath,
                                         "-m", mid)
                 .outputTo(System.out)
                 .errorTo(System.out)
@@ -180,9 +180,9 @@
 
         assertTrue(exitValue != 0);
 
-        // java -limitmods java.desktop -mp mods -m $TESTMODULE/$MAINCLASS
-        exitValue = executeTestJava("-limitmods", "java.desktop",
-                                    "-mp", modulepath,
+        // java --limit-modules java.desktop --module-path mods -m $TESTMODULE/$MAINCLASS
+        exitValue = executeTestJava("--limit-modules", "java.desktop",
+                                    "--module-path", modulepath,
                                     "-m", mid)
                 .outputTo(System.out)
                 .errorTo(System.out)
--- a/jdk/test/tools/launcher/modules/listmods/ListModsTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/tools/launcher/modules/listmods/ListModsTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -27,7 +27,7 @@
  * @modules java.se
  * @build ListModsTest CompilerUtils jdk.testlibrary.*
  * @run testng ListModsTest
- * @summary Basic test for java -listmods
+ * @summary Basic test for java --list-modules
  */
 
 import java.nio.file.Path;
@@ -41,7 +41,7 @@
 import static org.testng.Assert.*;
 
 /**
- * Basic tests for java -listmods
+ * Basic tests for java --list-modules
  */
 
 public class ListModsTest {
@@ -55,13 +55,13 @@
     public void setup() throws Exception {
         boolean compiled;
 
-        // javac -d mods/m1 -mp mods src/m1/**
+        // javac -d mods/m1 --module-path mods src/m1/**
         compiled = CompilerUtils.compile(
                 SRC_DIR.resolve("m1"),
                 MODS_DIR.resolve("m1"));
         assertTrue(compiled);
 
-        // javac -d upgrademods/java.transaction -mp mods src/java.transaction/**
+        // javac -d upgrademods/java.transaction --module-path mods src/java.transaction/**
         compiled = CompilerUtils.compile(
                 SRC_DIR.resolve("java.transaction"),
                 UPGRADEMODS_DIR.resolve("java.transaction"));
@@ -73,7 +73,7 @@
     @Test
     public void testListAll() throws Exception {
         OutputAnalyzer output
-            = executeTestJava("-listmods")
+            = executeTestJava("--list-modules")
                 .outputTo(System.out)
                 .errorTo(System.out);
         output.shouldContain("java.base");
@@ -85,7 +85,7 @@
     @Test
     public void testListOneModule() throws Exception {
         OutputAnalyzer output
-            = executeTestJava("-listmods:java.base")
+            = executeTestJava("--list-modules=java.base")
                 .outputTo(System.out)
                 .errorTo(System.out);
         output.shouldContain("java.base");
@@ -97,7 +97,7 @@
     @Test
     public void testListTwoModules() throws Exception {
         OutputAnalyzer output
-            = executeTestJava("-listmods:java.base,java.xml")
+            = executeTestJava("--list-modules", "java.base,java.xml")
                 .outputTo(System.out)
                 .errorTo(System.out);
         output.shouldContain("java.base");
@@ -111,7 +111,7 @@
     @Test
     public void testListUnknownModule() throws Exception {
         OutputAnalyzer output
-            = executeTestJava("-listmods:java.rhubarb")
+            = executeTestJava("--list-modules", "java.rhubarb")
                 .outputTo(System.out)
                 .errorTo(System.out);
         output.shouldNotContain("java.base");
@@ -123,7 +123,7 @@
     @Test
     public void testListWithModulePath() throws Exception {
         OutputAnalyzer output
-            = executeTestJava("-mp", MODS_DIR.toString(), "-listmods")
+            = executeTestJava("--module-path", MODS_DIR.toString(), "--list-modules")
                 .outputTo(System.out)
                 .errorTo(System.out);
         output.shouldContain("java.base");
@@ -135,8 +135,8 @@
     @Test
     public void testListWithUpgradeModulePath() throws Exception {
         OutputAnalyzer output
-            = executeTestJava("-upgrademodulepath", UPGRADEMODS_DIR.toString(),
-                              "-listmods:java.transaction")
+            = executeTestJava("--upgrade-module-path", UPGRADEMODS_DIR.toString(),
+                              "--list-modules", "java.transaction")
                 .outputTo(System.out)
                 .errorTo(System.out);
         output.shouldContain("exports javax.transaction.atomic");
@@ -147,7 +147,7 @@
     @Test
     public void testListWithLimitMods1() throws Exception {
         OutputAnalyzer output
-            = executeTestJava("-limitmods", "java.compact1", "-listmods")
+            = executeTestJava("--limit-modules", "java.compact1", "--list-modules")
                 .outputTo(System.out)
                 .errorTo(System.out);
         output.shouldContain("java.compact1");
@@ -160,9 +160,9 @@
     @Test
     public void testListWithLimitMods2() throws Exception {
         OutputAnalyzer output
-            = executeTestJava("-mp", MODS_DIR.toString(),
-                              "-limitmods", "java.compact1",
-                              "-listmods")
+            = executeTestJava("--module-path", MODS_DIR.toString(),
+                              "--limit-modules", "java.compact1",
+                              "--list-modules")
                 .outputTo(System.out)
                 .errorTo(System.out);
         output.shouldContain("java.base");
@@ -172,12 +172,12 @@
 
 
     /**
-     * java -version -listmods => should print version and exit
+     * java -version --list-modules => should print version and exit
      */
     @Test
     public void testListWithPrintVersion1() throws Exception {
         OutputAnalyzer output
-            = executeTestJava("-version", "-listmods")
+            = executeTestJava("-version", "--list-modules")
                 .outputTo(System.out)
                 .errorTo(System.out);
         output.shouldNotContain("java.base");
@@ -187,12 +187,12 @@
 
 
     /**
-     * java -listmods -version => should list modules and exit
+     * java --list-modules -version => should list modules and exit
      */
     @Test
     public void testListWithPrintVersion2() throws Exception {
         OutputAnalyzer output
-            = executeTestJava("-listmods", "-version")
+            = executeTestJava("--list-modules", "-version")
                 .outputTo(System.out)
                 .errorTo(System.out);
         output.shouldContain("java.base");
--- a/jdk/test/tools/launcher/modules/patch/basic/PatchTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/tools/launcher/modules/patch/basic/PatchTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -27,7 +27,7 @@
  * @modules jdk.compiler
  * @build PatchTest CompilerUtils JarUtils jdk.testlibrary.*
  * @run testng PatchTest
- * @summary Basic test for -Xpatch
+ * @summary Basic test for --patch-module
  */
 
 import java.io.File;
@@ -45,13 +45,13 @@
 
 
 /**
- * Compiles and launches a test that uses -Xpatch with two directories of
- * classes to override existing and add new classes to modules in the
- * boot layer.
+ * Compiles and launches a test that uses --patch-module with two directories
+ * of classes to override existing classes and add new classes to modules in
+ * the boot layer.
  *
- * The classes overridden or added via -Xpatch all define a public no-arg
- * constructor and override toString to return "hi". This allows the launched
- * test to check that the overridden classes are loaded.
+ * The classes overridden or added via --patch-module all define a public
+ * no-arg constructor and override toString to return "hi". This allows the
+ * launched test to check that the overridden classes are loaded.
  */
 
 @Test
@@ -76,7 +76,7 @@
     private static final Path PATCHES_DIR = Paths.get("patches");
 
 
-    // the classes overridden or added with -Xpatch
+    // the classes overridden or added with --patch-module
     private static final String[] CLASSES = {
 
         // java.base = boot loader
@@ -137,15 +137,15 @@
         String arg = Stream.of(CLASSES).collect(Collectors.joining(","));
 
         int exitValue
-            =  executeTestJava("-Xpatch:java.base=" + basePatches,
-                               "-Xpatch:jdk.naming.dns=" + dnsPatches,
-                               "-Xpatch:jdk.compiler=" + compilerPatches,
-                               "-XaddExports:java.base/java.lang2=test",
-                               "-XaddExports:jdk.naming.dns/com.sun.jndi.dns=test",
-                               "-XaddExports:jdk.naming.dns/com.sun.jndi.dns2=test",
-                               "-XaddExports:jdk.compiler/com.sun.tools.javac2=test",
-                               "-addmods", "jdk.naming.dns,jdk.compiler",
-                               "-mp", MODS_DIR.toString(),
+            =  executeTestJava("--patch-module", "java.base=" + basePatches,
+                               "--patch-module", "jdk.naming.dns=" + dnsPatches,
+                               "--patch-module", "jdk.compiler=" + compilerPatches,
+                               "--add-exports", "java.base/java.lang2=test",
+                               "--add-exports", "jdk.naming.dns/com.sun.jndi.dns=test",
+                               "--add-exports", "jdk.naming.dns/com.sun.jndi.dns2=test",
+                               "--add-exports", "jdk.compiler/com.sun.tools.javac2=test",
+                               "--add-modules", "jdk.naming.dns,jdk.compiler",
+                               "--module-path", MODS_DIR.toString(),
                                "-m", "test/jdk.test.Main", arg)
                 .outputTo(System.out)
                 .errorTo(System.out)
@@ -156,7 +156,7 @@
 
 
     /**
-     * Run test with -Xpatch and exploded patches
+     * Run test with ---patch-module and exploded patches
      */
     public void testWithExplodedPatches() throws Exception {
 
@@ -175,7 +175,7 @@
 
 
     /**
-     * Run test with -Xpatch and patches in JAR files
+     * Run test with ---patch-module and patches in JAR files
      */
     public void testWithJarPatches() throws Exception {
 
@@ -195,7 +195,7 @@
 
 
     /**
-     * Run test with -Xpatch and patches in JAR files and exploded patches
+     * Run test with ---patch-module and patches in JAR files and exploded patches
      */
     public void testWithJarAndExplodedPatches() throws Exception {
 
--- a/jdk/test/tools/launcher/modules/patch/basic/src/test/jdk/test/Main.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/tools/launcher/modules/patch/basic/src/test/jdk/test/Main.java	Wed Aug 10 15:51:25 2016 -0700
@@ -22,7 +22,7 @@
  */
 
 /**
- * Used with -Xpatch to exercise the replacement or addition of classes
+ * Used with --patch-module to exercise the replacement or addition of classes
  * in modules that are linked into the runtime image.
  */
 
--- a/jdk/test/tools/launcher/modules/patch/systemmodules/PatchSystemModules.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/tools/launcher/modules/patch/systemmodules/PatchSystemModules.java	Wed Aug 10 15:51:25 2016 -0700
@@ -69,7 +69,7 @@
         for (String name : modules) {
             assertTrue(CompilerUtils.compile(src.resolve(name),
                                              MODS_DIR,
-                                             "-modulesourcepath", src.toString()));
+                                             "--module-source-path", src.toString()));
         }
 
         // compile patched source
@@ -93,16 +93,16 @@
 
         Path home = Paths.get(JAVA_HOME);
         runTest(home,
-                "-mp", MODS_DIR.toString(),
+                "--module-path", MODS_DIR.toString(),
                 "-m", "m1/p1.Main", "1");
         runTest(home,
-                "-Xpatch:java.base=" + patchedJavaBase.toString(),
-                "-mp", MODS_DIR.toString(),
+                "--patch-module", "java.base=" + patchedJavaBase,
+                "--module-path", MODS_DIR.toString(),
                 "-m", "m1/p1.Main", "1");
 
         runTest(home,
-                "-Xpatch:m2=" + patchedM2.toString(),
-                "-mp", MODS_DIR.toString(),
+                "--patch-module", "m2=" + patchedM2.toString(),
+                "--module-path", MODS_DIR.toString(),
                 "-m", "m1/p1.Main", "2");
     }
 
@@ -117,10 +117,10 @@
         runTest(IMAGE,
                 "-m", "m1/p1.Main", "1");
         runTest(IMAGE,
-                "-Xpatch:java.base=" + patchedJavaBase.toString(),
+                "--patch-module", "java.base=" + patchedJavaBase,
                 "-m", "m1/p1.Main", "1");
         runTest(IMAGE,
-                "-Xpatch:m2=" + patchedM2.toString(),
+                "--patch-module", "m2=" + patchedM2.toString(),
                 "-m", "m1/p1.Main", "2");
     }
 
@@ -138,12 +138,12 @@
 
         // Fail to upgrade m1.jar with mismatched hash
         runTestWithExitCode(getJava(IMAGE),
-                "-upgrademodulepath", m1.toString(),
+                "--upgrade-module-path", m1.toString(),
                 "-m", "m1/p1.Main");
 
         runTestWithExitCode(getJava(IMAGE),
-                "-Xpatch:java.base=" + PATCH_DIR.resolve(JAVA_BASE).toString(),
-                "-upgrademodulepath", m1.toString(),
+                "--patch-module", "java.base=" + PATCH_DIR.resolve(JAVA_BASE),
+                "--upgrade-module-path", m1.toString(),
                 "-m", "m1/p1.Main", "1");
     }
 
@@ -185,14 +185,14 @@
 
         jar("--create",
             "--file=" + m2.toString(),
-            "--modulepath", JARS_DIR.toString(),
+            "--module-path", JARS_DIR.toString(),
             "--hash-modules", "m1",
             "-C", MODS_DIR.resolve("m2").toString(), ".");
 
 
         String mpath = JARS_DIR.toString() + File.pathSeparator + JMODS.toString();
-        execTool("jlink", "--modulepath", mpath,
-                 "--addmods", "m1",
+        execTool("jlink", "--module-path", mpath,
+                 "--add-modules", "m1",
                  "--output", IMAGE.toString());
     }
 
@@ -216,7 +216,7 @@
     }
 
     static String getJava(Path image) {
-        boolean isWindows = System.getProperty("os.name").toLowerCase().startsWith("win");
+        boolean isWindows = System.getProperty("os.name").startsWith("Windows");
         Path java = image.resolve("bin").resolve(isWindows ? "java.exe" : "java");
         if (Files.notExists(java))
             throw new RuntimeException(java + " not found");
--- a/jdk/test/tools/launcher/modules/patch/systemmodules/src1/java.base/jdk/internal/modules/SystemModules.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/tools/launcher/modules/patch/systemmodules/src1/java.base/jdk/internal/modules/SystemModules.java	Wed Aug 10 15:51:25 2016 -0700
@@ -24,7 +24,7 @@
 package jdk.internal.module;
 
 /*
- * Test -Xpatch:java.base=jdk/modules/java.base to override
+ * Test --patch-module java.base=jdk/modules/java.base to override
  * java.base with an exploded image
  */
 public final class SystemModules {
--- a/jdk/test/tools/launcher/modules/upgrademodulepath/UpgradeModulePathTest.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/tools/launcher/modules/upgrademodulepath/UpgradeModulePathTest.java	Wed Aug 10 15:51:25 2016 -0700
@@ -27,7 +27,7 @@
  * @modules jdk.compiler
  * @build UpgradeModulePathTest CompilerUtils jdk.testlibrary.*
  * @run testng UpgradeModulePathTest
- * @summary Basic test for java -upgrademodulepath
+ * @summary Basic test for java --upgrade-module-path
  */
 
 import java.io.File;
@@ -65,19 +65,19 @@
                 MODS_DIR.resolve("java.enterprise"));
         assertTrue(compiled);
 
-        // javac -d upgrademods/java.transaction -mp mods src/java.transaction/**
+        // javac -d upgrademods/java.transaction --module-path mods src/java.transaction/**
         compiled = CompilerUtils.compile(
                 SRC_DIR.resolve("java.transaction"),
                 UPGRADEDMODS_DIR.resolve("java.transaction"),
-                "-mp", MODS_DIR.toString());
+                "--module-path", MODS_DIR.toString());
         assertTrue(compiled);
 
-        // javac -d mods -upgrademodulepath upgrademods -mp mods src/test/**
+        // javac -d mods --upgrade-module-path upgrademods --module-path mods src/test/**
         compiled = CompilerUtils.compile(
                 SRC_DIR.resolve("test"),
                 MODS_DIR.resolve("test"),
-                "-upgrademodulepath", UPGRADEDMODS_DIR.toString(),
-                "-mp", MODS_DIR.toString());
+                "--upgrade-module-path", UPGRADEDMODS_DIR.toString(),
+                "--module-path", MODS_DIR.toString());
         assertTrue(compiled);
 
     }
@@ -92,8 +92,8 @@
 
         int exitValue
             = executeTestJava(
-                "-upgrademodulepath", UPGRADEDMODS_DIR.toString(),
-                "-mp", MODS_DIR.toString(),
+                "--upgrade-module-path", UPGRADEDMODS_DIR.toString(),
+                "--module-path", MODS_DIR.toString(),
                 "-m", mid)
             .outputTo(System.out)
             .errorTo(System.out)
@@ -116,8 +116,8 @@
 
         int exitValue
             = executeTestJava(
-                "-upgrademodulepath", upgrademodulepath,
-                "-mp", MODS_DIR.toString(),
+                "--upgrade-module-path", upgrademodulepath,
+                "--module-path", MODS_DIR.toString(),
                 "-m", mid)
             .outputTo(System.out)
             .errorTo(System.out)
--- a/jdk/test/tools/lib/tests/Helper.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/tools/lib/tests/Helper.java	Wed Aug 10 15:51:25 2016 -0700
@@ -164,7 +164,7 @@
         Path srcMod = src.resolve(moduleName);
         JImageGenerator.generateModuleInfo(srcMod, packages, dependencies);
         Path destination = classes.resolve(moduleName);
-        if (!JImageGenerator.compile(srcMod, destination, "-modulepath", modulePath, "-g")) {
+        if (!JImageGenerator.compile(srcMod, destination, "--module-path", modulePath, "-g")) {
             throw new AssertionError("Compilation failure");
         }
         return destination;
--- a/jdk/test/tools/lib/tests/JImageGenerator.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/tools/lib/tests/JImageGenerator.java	Wed Aug 10 15:51:25 2016 -0700
@@ -106,10 +106,10 @@
     private static final String POST_PROCESS_OPTION = "--post-process-path";
     private static final String MAIN_CLASS_OPTION = "--main-class";
     private static final String CLASS_PATH_OPTION = "--class-path";
-    private static final String MODULE_PATH_OPTION = "--modulepath";
-    private static final String ADD_MODS_OPTION = "--addmods";
-    private static final String LIMIT_MODS_OPTION = "--limitmods";
-    private static final String PLUGINS_MODULE_PATH = "--plugin-module-path";
+    private static final String MODULE_PATH_OPTION = "--module-path";
+    private static final String ADD_MODULES_OPTION = "--add-modules";
+    private static final String LIMIT_MODULES_OPTION = "--limit-modules";
+    private static final String PLUGIN_MODULE_PATH = "--plugin-module-path";
 
     private static final String CMDS_OPTION = "--cmds";
     private static final String CONFIG_OPTION = "--config";
@@ -534,7 +534,7 @@
                 options.add(dir.toString());
             }
             if (!pluginModulePath.isEmpty()) {
-                options.add(PLUGINS_MODULE_PATH);
+                options.add(PLUGIN_MODULE_PATH);
                 options.add(toPath(pluginModulePath));
             }
             options.addAll(this.options);
@@ -632,11 +632,11 @@
                 options.add(output.toString());
             }
             if (!addMods.isEmpty()) {
-                options.add(ADD_MODS_OPTION);
+                options.add(ADD_MODULES_OPTION);
                 options.add(addMods.stream().collect(Collectors.joining(",")));
             }
             if (!limitMods.isEmpty()) {
-                options.add(LIMIT_MODS_OPTION);
+                options.add(LIMIT_MODULES_OPTION);
                 options.add(limitMods.stream().collect(Collectors.joining(",")));
             }
             if (!jars.isEmpty() || !jmods.isEmpty()) {
@@ -648,7 +648,7 @@
                 options.add(modulePath);
             }
             if (!pluginModulePath.isEmpty()) {
-                options.add(PLUGINS_MODULE_PATH);
+                options.add(PLUGIN_MODULE_PATH);
                 options.add(toPath(pluginModulePath));
             }
             options.addAll(this.options);
--- a/jdk/test/tools/pack200/Utils.java	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/tools/pack200/Utils.java	Wed Aug 10 15:51:25 2016 -0700
@@ -111,7 +111,7 @@
 
         compiler("-d",
                 XCLASSES.getName(),
-                "-XaddExports:jdk.jdeps/com.sun.tools.classfile=ALL-UNNAMED",
+                "--add-exports=jdk.jdeps/com.sun.tools.classfile=ALL-UNNAMED",
                 "@" + tmpFile.getAbsolutePath());
 
         jar("cvfe",
@@ -148,7 +148,7 @@
         init();
         List<String> cmds = new ArrayList<String>();
         cmds.add(getJavaCmd());
-        cmds.add("-XaddExports:jdk.jdeps/com.sun.tools.classfile=ALL-UNNAMED");
+        cmds.add("--add-exports=jdk.jdeps/com.sun.tools.classfile=ALL-UNNAMED");
         cmds.add("-cp");
         cmds.add(VerifierJar.getName());
         cmds.add("sun.tools.pack.verify.Main");
--- a/jdk/test/tools/pack200/pack200-verifier/make/build.xml	Wed Aug 10 22:48:25 2016 +0100
+++ b/jdk/test/tools/pack200/pack200-verifier/make/build.xml	Wed Aug 10 15:51:25 2016 -0700
@@ -27,7 +27,7 @@
 	   destdir="${build}/classes"
 	   verbose="no"
 	   debug="on">
-       <compilerarg value="-XaddExports:jdk.jdeps/com.sun.tools.classfile"/>
+       <compilerarg value="--add-exports=jdk.jdeps/com.sun.tools.classfile"/>
      </javac>
   </target>