Bug 526934 - Can't launch "JUnit plug-in test" with Java 9
Change-Id: Ie691217110b15daff7fc7b6de93c2e88b91d4e63
Signed-off-by: Vikas Chandra <Vikas.Chandra@in.ibm.com>
diff --git a/ui/org.eclipse.pde.launching/src/org/eclipse/pde/launching/JUnitLaunchConfigurationDelegate.java b/ui/org.eclipse.pde.launching/src/org/eclipse/pde/launching/JUnitLaunchConfigurationDelegate.java
index 8139343..f43ed94 100644
--- a/ui/org.eclipse.pde.launching/src/org/eclipse/pde/launching/JUnitLaunchConfigurationDelegate.java
+++ b/ui/org.eclipse.pde.launching/src/org/eclipse/pde/launching/JUnitLaunchConfigurationDelegate.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2015 IBM Corporation and others.
+ * Copyright (c) 2006, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -181,6 +181,13 @@
programArgs.add("-testpluginname"); //$NON-NLS-1$
programArgs.add(getTestPluginId(configuration));
+ IVMInstall launcher = VMHelper.createLauncher(configuration);
+ boolean isModular = JavaRuntime.isModularJava(launcher);
+ if (isModular) {
+ String modAllSystem = "--add-modules=ALL-SYSTEM"; //$NON-NLS-1$
+ if (!vmArguments.contains(modAllSystem))
+ vmArguments.add(modAllSystem);
+ }
}
/**