- // Set defaults
- if (jvmArgs == null)
- jvmArgs = defaultJvmArgs;
- if (args == null)
- args = defaultArgs;
- if (systemProperties == null)
- systemProperties = new HashMap();
-
- if (!execDir.exists())
- execDir.mkdirs();
-
- // Build command
- List cmdList = new ArrayList();
- cmdList.add(jvm);
- cmdList.addAll(Arrays.asList(jvmArgs));
- if (!systemProperties.containsKey("osgi.bundles"))
- cmdList.add("-Dosgi.bundles="
- + osgiBootArtifact.getFile().getCanonicalPath()
- + "@start");
- if (!systemProperties.containsKey("slc.osgi.locations"))
- cmdList.add("-Dslc.osgi.locations=" + osgiLocations);
- for (Iterator keys = systemProperties.keySet().iterator(); keys
- .hasNext();) {
- Object key = keys.next();
- Object value = systemProperties.get(key);
- String strValue = null;
- if (value != null) {
- strValue = value.toString().trim();
- strValue = strValue.replaceAll("\n", "");
- strValue = strValue.replaceAll("\t", "");
- }
- cmdList.add("-D" + key + "=" + strValue);
+ protected void execNonForked(LocationsStruct locationsStruct)
+ throws Exception {
+ // Set defaults
+ if (args == null)
+ args = defaultArgs;
+
+ // if (!execDir.exists())
+ // execDir.mkdirs();
+ // System.setProperty("user.dir", execDir.getCanonicalPath());
+
+ // Build command
+ List cmdList = new ArrayList();
+
+ // System properties
+ if (!systemProperties.containsKey("osgi.bundles")) {
+ if (locationsStruct.osgiBootArtifact == null)
+ throw new Exception("No SLC OSGi boot bundle available.");
+ System.setProperty("osgi.bundles", locationsStruct.osgiBootArtifact
+ .getFile().getCanonicalPath()
+ + "@start");
+ }
+
+ if (!systemProperties.containsKey("slc.osgi.locations"))
+ System.setProperty("slc.osgi.locations",
+ locationsStruct.osgiLocations);
+
+ for (Iterator keys = systemProperties.keySet().iterator(); keys
+ .hasNext();) {
+ Object key = keys.next();
+ Object value = systemProperties.get(key);
+ String strValue = null;
+ if (value != null) {
+ strValue = value.toString().trim();
+ strValue = strValue.replaceAll("\n", "");
+ strValue = strValue.replaceAll("\t", "");
+ }
+ System.setProperty(key.toString(), strValue);
+ }
+
+ // Program arguments
+ cmdList.addAll(Arrays.asList(args));
+ if (argsToAppend != null)
+ cmdList.addAll(Arrays.asList(argsToAppend));
+
+ String[] cmd = (String[]) cmdList.toArray(new String[0]);
+ System.out.println("Equinox arguments (non forked):");
+ printCommand(cmd);
+
+ EclipseStarter.startup(cmd, null);
+
+ if (wait) {
+ while (EclipseStarter.isRunning()) {
+ Thread.sleep(500);