Lines 46-52
Link Here
|
46 |
ensureEclipseExeExists(); |
46 |
ensureEclipseExeExists(); |
47 |
} else { |
47 |
} else { |
48 |
prepareJavaCommand(); |
48 |
prepareJavaCommand(); |
49 |
ensureStartupJarExists(); |
|
|
50 |
} |
49 |
} |
51 |
ensureVmExists(); |
50 |
ensureVmExists(); |
52 |
} |
51 |
} |
Lines 65-71
Link Here
|
65 |
cmdarray[4 + eclipseArgs.size() + i] = (String) vmArgs.get(i); |
64 |
cmdarray[4 + eclipseArgs.size() + i] = (String) vmArgs.get(i); |
66 |
} |
65 |
} |
67 |
} |
66 |
} |
68 |
private void prepareJavaCommand() { |
67 |
private void prepareJavaCommand() throws Exception { |
69 |
List vmArgs = Options.getVmArgs(); |
68 |
List vmArgs = Options.getVmArgs(); |
70 |
List eclipseArgs = Options.getEclipseArgs(); |
69 |
List eclipseArgs = Options.getEclipseArgs(); |
71 |
cmdarray = new String[1 + vmArgs.size() + 3 + eclipseArgs.size()]; |
70 |
cmdarray = new String[1 + vmArgs.size() + 3 + eclipseArgs.size()]; |
Lines 74-80
Link Here
|
74 |
cmdarray[1 + i] = (String) vmArgs.get(i); |
73 |
cmdarray[1 + i] = (String) vmArgs.get(i); |
75 |
} |
74 |
} |
76 |
cmdarray[1 + vmArgs.size()] = "-cp"; //$NON-NLS-1$ |
75 |
cmdarray[1 + vmArgs.size()] = "-cp"; //$NON-NLS-1$ |
77 |
cmdarray[2 + vmArgs.size()] = "startup.jar"; //$NON-NLS-1$ |
76 |
cmdarray[2 + vmArgs.size()] = getStartupJar(); |
78 |
cmdarray[3 + vmArgs.size()] = "org.eclipse.core.launcher.Main"; //$NON-NLS-1$ |
77 |
cmdarray[3 + vmArgs.size()] = "org.eclipse.core.launcher.Main"; //$NON-NLS-1$ |
79 |
for (int i = 0; i < eclipseArgs.size(); i++) { |
78 |
for (int i = 0; i < eclipseArgs.size(); i++) { |
80 |
cmdarray[4 + vmArgs.size() + i] = (String) eclipseArgs.get(i); |
79 |
cmdarray[4 + vmArgs.size() + i] = (String) eclipseArgs.get(i); |
Lines 169-181
Link Here
|
169 |
throw new Exception("File " + eclipseExe.getAbsolutePath() //$NON-NLS-1$ |
168 |
throw new Exception("File " + eclipseExe.getAbsolutePath() //$NON-NLS-1$ |
170 |
+ " does not exists. Pass a correct -eclipsehome option"); //$NON-NLS-1$ |
169 |
+ " does not exists. Pass a correct -eclipsehome option"); //$NON-NLS-1$ |
171 |
} |
170 |
} |
172 |
private void ensureStartupJarExists() throws Exception { |
171 |
private String getStartupJar() throws Exception { |
173 |
File startupJar = new File(Options.getEclipseHome(), "startup.jar"); //$NON-NLS-1$ |
172 |
File pluginsDir = new File(Options.getEclipseHome(), "plugins/"); //$NON-NLS-1$ |
174 |
if (startupJar.exists() && !startupJar.isDirectory()) { |
173 |
if (!pluginsDir.exists() || !pluginsDir.isDirectory()) |
175 |
return; |
174 |
throw new Exception("Plugins directory " + pluginsDir.getAbsolutePath() //$NON-NLS-1$ |
176 |
} |
|
|
177 |
throw new Exception("File " + startupJar.getAbsolutePath() //$NON-NLS-1$ |
178 |
+ " does not exists. Pass a correct -eclipsehome option"); //$NON-NLS-1$ |
175 |
+ " does not exists. Pass a correct -eclipsehome option"); //$NON-NLS-1$ |
|
|
176 |
File[] plugins = pluginsDir.listFiles(); |
177 |
for (int i = 0; i < plugins.length; i++) { |
178 |
String file = plugins[i].getName(); |
179 |
if (file.startsWith("org.eclipse.equinox.launcher") && file.endsWith(".jar") && !plugins[i].isDirectory()) //$NON-NLS-1$ //$NON-NLS-2$ |
180 |
return "plugins/" + file; //$NON-NLS-1$ |
181 |
} |
182 |
throw new Exception("Plugins directory " + pluginsDir.getAbsolutePath() //$NON-NLS-1$ |
183 |
+ " does not contain a valid startup jar. Pass a correct -eclipsehome option"); //$NON-NLS-1$ |
179 |
} |
184 |
} |
180 |
/** |
185 |
/** |
181 |
* @return Exception |
186 |
* @return Exception |